upload

How to upload binary data using POST

假装没事ソ 提交于 2019-12-08 05:22:27
问题 I have something like this in my code: String boundary = "thisIsMyBoundaryString"; StringBuilder body = new StringBuilder(); ... byte[] data = bos.toByteArray(); body.append(new String(data)); body.append("\r\n--" + boundary + "--\r\n"); String entity = body.toString(); I'm building a POST request and need to insert some binary data (JPEG compressed bitmap). After appending byteArray, I want to append newLine and boundary string, but the StringBuilder gets corrupted - seems that the bytes

Will removing an iframe from the DOM always stop an upload POSTed from that iframe?

强颜欢笑 提交于 2019-12-08 05:16:13
问题 I'm doing some async file uploading with iframes, and I'm wondering if simply pruning the iframe from the DOM is enough to cancel an upload. This discussion seems to imply that this a poor approach to the problem overall, but annoyingly the JS `expert' refuses to reveal his solution. Anyway, removing the iframe works in Gecko + WebKit, but I'm wondering if people have experience with other DOM implementations. 回答1: That dude in the discussion doesn't have a clue of what he is talking about,

how insert and retrieve images to and from database using php

末鹿安然 提交于 2019-12-08 05:13:29
问题 im trying to upload an image for a member profile and store it in a database using php then retrieve it but its does not work with me this is what im trying for inserting the image : <html> <head> <title> Upload an image </title> </head> <body> <form action="index.php" method="POST" enctype="multipart/from/data"> File: <input type="file" name="image" > <input type="submit" value="upload"> </form> </body> </html> <?php mysql_connect("localhost", "root","") or die ("could not connect to the

Why is this form not submitting inside the target iframe?

℡╲_俬逩灬. 提交于 2019-12-08 04:50:21
问题 I've created a form that targets an iframe to submit an image. I absolutely had this working previously, but now the whole page submits, instead of just the iframe. I'm at a total loss. HTML: <form id="upload-form" name="upload-form" class="" action="/handle/upload" method="post" enctype="multipart/form-data"> <div class="fileinput-wrap"> <label for="fileinput">Image input</label> <input type="file" name="file" id="fileinput" /> </div> <input type="submit" id="submitter" name="submitter" /> <

Can Oracle SQL*Loader process XML?

妖精的绣舞 提交于 2019-12-08 04:39:25
Does Oracle offer a standardized upload of XML formatted files? I thought that the canonical format that is used for XML output, structure = ROWSET/ROW/columname , could be uploaded back into the table again, by just running sqlldr with appropriate control file contents. But I cannot find anything about this anywhere on the web, and error messages after trials seem to indicate that it is only possible to upload XML into XML-type formatted tables, where I just want to upload data in a plain table but supply the data in XML format. No, SQL*Loader can only process "flat" files. One option is to

Php ajax file upload error

落爺英雄遲暮 提交于 2019-12-08 04:16:20
问题 I want to upload file using ajax but i dont get data in php $_FILES and I get it in $_REQUEST . How do I do it. Below is my jquery code.Ajax is not working for file uploading so is there any code so that i can merge with existing code for file uploading process. <script> jQuery(function($){ jQuery('#btn').click(function(){ var data = {}, ticks = []; $('.ajax_elements').each(function(_, elem) { data[this.id] = this.value; }); $.ajax({ type : 'POST', url : 'app_process.php', data : data, cache

Python pysftp put_r does not work on Windows

夙愿已清 提交于 2019-12-08 04:16:04
问题 I'd like to upload multiple files from a Windows directory to an SFTP server using pysftp 0.2.8. I've read up the doc and it suggests to use put_d or put_r but both give me the following error: OSError: Invalid path: sftp_local_path = r'C:\Users\Swiss\some\path' sftp_remote_path = '/FTP/LPS Data/ATC/RAND/20191019_RAND/XML' with pysftp.Connection("xxx.xxx.xxx.xxx", username=myUsername, password=myPassword) as sftp: with sftp.cd(sftp_remote_path): sftp.put_r(sftp_local_path, sftp_remote_path)

Codeigniter upload PDF problem

自古美人都是妖i 提交于 2019-12-08 04:11:22
问题 I am uploading a PDF using the codeigniter upload library, the PDF is uploaded if the user is adding a press, the same form is used to add a new article. This difference between the two is that a press release needs a PDF, but a news article does not. However when I submit my form without add PDF to the upload field, I get an error you did not select a file to upload How can I make it so I don't have upload a file? function add () { $data = array(); //set some validation rules $this->form

primefaces upload not doing anything [duplicate]

≡放荡痞女 提交于 2019-12-08 04:11:21
问题 This question already has answers here : How to use PrimeFaces p:fileUpload? Listener method is never invoked or UploadedFile is null / throws an error / not usable (10 answers) Closed 4 years ago . i am now trying to use primefaces instead of a home-brewed file upload system, only problem i am having is it seems not to do anything, any ideas why ? i am using glassfish, and i have added commons-io-1.4.jar commons-fileupload-1.2.1/jar to my libraries in netbeans heres my xhtml <p:fileUpload

alfresco file Upload Unexpected error occurred during upload of new content

让人想犯罪 __ 提交于 2019-12-08 04:11:10
问题 I want to upload a file to alfresco using the backend Webscript: alfresco/service/api/upload . Here is how I build my json: _ticket = Login.getAlfTicket(login, psswd); String url = "http://localhost:8080/alfresco/service/api/upload"; File file = new File("C:/the-file-name.txt"); byte[] bytes = Files.readAllBytes(file.toPath()); bytes = Base64.encodeBase64(bytes); JSONObject json = new JSONObject(); json.put("filedata", new String(bytes)); json.put("siteid", "google"); json.put("containerId",