FAQ Database Discussion Community


Download file via jquery ajax post

javascript,jquery,ajax,multipartform-data
I am trying to export my web page data and download it as excel file. but the download does not start even the response return succeed. $.ajax({ type: "POST", url: _url, contentType: 'multipart/form-data;boundary=SzB12x', data: json, }); The responseText something like this: PK�J;Fxl/theme/theme1.xml�YOo�6����,[r��n;v��i����#-�kJH:�oC{0X7�2��mZ���d��[email protected]�(٦b:M���������{|��^�[email protected]��*"w$�!0I�[�՚n�i��'����iH� g�,��|�J�...

Node.js File Upload (Express 4, MongoDB, GridFS, GridFS-Stream)

javascript,node.js,mongodb,multipartform-data,gridfs-stream
I am trying to setup a file API in my node.js application. My goal is to be able to write the file stream directly to gridfs, without needing to store the file to disk initially. It seems like my create code is working. I am able to save a file...

$_FILES and $_POST data empty when uploading certain files

php,html,multipartform-data
I've noticed that depending on the video I'm uploading that sometimes the entire $_POST and $_FILES array will be empty. This is an odd occurrence but I have found it in a few videos. For the sake of testing the videos I was using are all of video/mp4 file type....

Ajax PHP file upload mistake

php,ajax,multipartform-data
I have this code in client side: fileUpload: function monkey(){ var file = t.gI("photoFile"); //get element by photoFile var formData = new FormData(); console.log(file.files.length); formData.append("upload", file.files[0]); var req = t.gR(); //XMLHTTPRequest req.open('POST', 'php/fileupload.php', true); req.setRequestHeader("Content-Type", "multipart/form-data", true); req.send(formData); req.onreadystatechange = function () { if (req.readyState === 4) { if (req.status...

Does multipart/formdata content type automatically resume upload after reconnect?

angularjs,file-upload,multipartform-data,angular-file-upload
I'm using angular-file-upload library which uses multipart/formdata content type for file uploading. When I tried to simulate network error on the demo page by simply unplugging network cable I saw progress bar stopped and started from the current upload state after reconnecting cable. Does it mean that multipart/formdata request automatically...

Ajax callback with FormData fails for large files

javascript,ajax,asp.net-mvc,multipartform-data,form-data
I've a input file control where I can upload any kind of file. So, I'm getting the file and storing in a FormData and making an ajax call to my controller. It is working fine with Images and small .mp3 files. But when I'm uploading .mp3 files more than 5MB,...

ajax submitting forms using FormData

javascript,jquery,ajax,forms,multipartform-data
I was trying to submit only specific inputs of a very large form and I wanted to do this using ajax. I had this and it was working fine. This will submit all inputs within #someDiv. $(".save").click(function () { dat = $.param($('#someDiv').find('input')); $.ajax({ type: "POST", url: "...", data: dat, success:...

Casting multiform part to a file

java,html,jsf,zip,multipartform-data
I have a managed bean. An HTML/JSF page sends a zipped file as a Part. I need to extract the contents from it, but to do that I need it to be File. Is it possible to cast the Part to File like as follows, and then treat it like...

http-builder in groovy uploading multiple files in server

groovy,multipartform-data,httpbuilder
I am trying to upload multiple files in a server using http builder-groovy.The below code doesn't works.Getting an error " Request entity is too large" .I have imported all the packages and defined all the variables. Is there any alternative for this using restclient-groovy? can anyone give the reason? thanks...

Javascript: Sending arrayBuffer using XMLHttpRequest

javascript,xmlhttprequest,multipartform-data,arraybuffer
I want to send a multipart form using XMLHttpRequest. The file I want to attach is a jpg file. Appending the file to the FormData object works fine. But I'd like to process the image file before sending it. Therefore I have a library that takes a Uint8Array as input...

Probleme with my Servlet and @FormDataParam Jersey

java,rest,jersey,multipartform-data,jersey-2.0
I have a problem with my web-services using Jersey. I have a form composed of two inputs, one of type "file" and one of type "text". The problem is that when I only use the input of type "file", everything works fine, but when I add the second one, of...

Upload multiple images angular - mean stack

javascript,angularjs,multipartform-data,mean-stack
I'm currently working with a mean stack, and I want to be able to choose multiple pictures in my angular project. Each picture should then be loaded into some sort of thumbnail(with a remove button for each picture :o)), and first when I press the "save" button the pictures should...

Error while uploading image to server with Swift

swift,post,upload,server,multipartform-data
Hi so here's the code I'm using to upload an image to our server via a link. if (currentElementName == "uploadUrl") { let returnUploadURL = string var imageData = UIImagePNGRepresentation(pictureImage.image) if imageData != nil{ var request = NSMutableURLRequest(URL: NSURL(string: returnUploadURL)!) var session = NSURLSession.sharedSession() println(request) request.HTTPMethod = "POST" var boundary...

encoder function for multipart/form-data in groovy

encoding,groovy,multipartform-data,rest-client
I need to form a 'multipart/form-data' REST request with jpeg image and JSON file as the content.I am stuck with encoding the 'multipart/form-data' as a zip file. Can someone tell me, how I can achieve this with groovy RESTClient? I could not find any documentation regarding this. ...

Spring Multipart File Upload

spring,spring-mvc,multipartform-data,thymeleaf
I'm trying to upload a multipart file using Spring mvc, tomcat, Tyhmleaf but can't get it work. java.lang.NullPointerException com.cars.actions.controller.brand.BrandController.persist2(BrandController.java:75) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:483) My controller: @RequestMapping(value =...

Jersey REST Client : Posting MultiPart data

java,rest,jersey,multipartform-data,jersey-client
I am trying to write a Jersey client app which can post multi part form data to a Restful Jersey service. I need to post a CSV file with the data and a JSON with meta-data. I am using Jersey client 1.18.3. Here is my code (some names have been...

How to handle FineUploader POST request in Java in PlayFramework?

multipartform-data,playframework-2.2,fine-uploader
I am trying to integrate FineUploader in my play framework code. View part is set up properly and it is working fine. I am not clear how to retrieve file in my controllers upload method. And other query parameters, qquuid, qqfilename, content-type e.tc. Following is the dump of file upload...

Golang GET multipart form-data

html,go,get,multipartform-data
Let say I have a html form <form enctype="multipart/form-data" action="http://localhost:8080/incarcat" method="post"> <input type="file" name="file" multiple="multiple"/> <input type="checkbox" name="delete" value="delete"> <input type="submit" value="Load" /> </form> and the following go code read_form, err := req.MultipartReader() for { part, err_part := read_form.NextPart() if err_part == io.EOF { break } if part.FormName() == "file"...

javascript send post parameters with file

java,extjs,upload,multipartform-data,payload
Trying to upload a file with some parameters, I've changed the Ext upload plugin to upload some files with post parameters. The ext uploader code (ux.upload.uploader.FormDataUploader) : uploadItem : function(item) { file = item.getFileApiObject(); item.setUploading(); formData = new FormData(); // mycode goes here to append some parameters formData.append(file.name, file); xhr...

javax.mail.internet.ParseException: In Content-Type string , expected '/', got :

java,javamail,multipartform-data
I want to implement mail with attached file using JSF. I tried this code: private Part file; private String sendFromGMail(String from, String pass, String[] to, String subject, String body) { String status; Properties props = System.getProperties(); String host = "smtp.gmail.com"; props.put("mail.smtp.starttls.enable", "true"); props.put("mail.smtp.host", host); props.put("mail.smtp.user", from); props.put("mail.smtp.password", pass); props.put("mail.smtp.port", "587");...

Android eclipse error on File upload to server

android,apache,http,multipartform-data,multipartentity
In my android eclipse project, i want to upload image file with name and email fields to server. But i got the following error : my logcat is following : NoSuchFieldError - BasicHeaderValueFormatter.INSTANCE E/AndroidRuntime(25348): Caused by: java.lang.NoSuchFieldError: org.apache.http.message.BasicHeaderValueFormatter.INSTANCE my entire logcat : E/AndroidRuntime(25348): FATAL EXCEPTION: AsyncTask #1 E/AndroidRuntime(25348): Process: com.example.uploadfiles,...

Uploading an image and parameters with multipart/form-data in Swift

ios,json,swift,multipartform-data
I want to upload an image to a Drupal endpoint. The problem I have is that I receive an HTTP 200 OK response with text/html content type. In the HTML response, there is a clear message that the node has been correctly created. But on the server side the image...

upload image from ipad app to node js server using multiparty

ios,node.js,express,image-uploading,multipartform-data
I am very new to javascript and node js. I am working on uploading image from my iPad app to rest api of node js(express js) using multiparty module. Here is my image upload code in objective c. NSData *imgData = UIImageJPEGRepresentation(img.image, 0.2); NSString *urlString = @"http://localhost:3000/api/uploadimage"; NSString *str =...

upload multiple files , enctype=“multipart/form-data”

file,http,spring-mvc,multipartform-data
I want to upload multiple files to the controller but its taking only one. I am using multipart for file transfer. How to get the multiple files to the controller side. I am not able to access bytes and filename. Its throwing errors, @RequestMapping(value = "/home/step38/uploadReport", method = RequestMethod.POST) public...

Multipart form: How to send and get pararmeters in an hidden input in JSP

jsp,input,hidden,multipartform-data
I have a multipart form with a few fields which values I need to send to a jsp file. This is the multipart form and this is how I send the parameters (in non multipart, it works perfectly) <div class="createform"> <form enctype="multipart/form-data" name="create" action="createcompetition.jsp" method="post"> <ul> <li> <label for="name">Competition Name</label>...

How to save FormData into sql

sql-server,asp.net-web-api,multipartform-data
I need to store the path of the file along with its properties into a sql database. Currently all I can do is store the file on the server. I can see the file properties in the controller but I do not know how to access them. public class File...

Incorrect file content after multipart upload

node.js,multipartform-data,filepicker.io
I am trying to upload file to S3 using Filepicker API and request.js module. content = "ABCDEF" options = url: 'https://www.filepicker.io/api/store/S3' preambleCRLF: true # tried also with false postambleCRLF: true # tried also with false qs: key: 'XXX' store: 'S3' mimetype: 'text/csv' path: 'some-path.csv' container: 'my-bucket' access: 'public' multipart: [...

Upload image to server as multipart file in ios 7

objective-c,post,ios7,nsurlconnection,multipartform-data
In my ios 7 application I am trying to upload an Image with its properties to my server. I want to pass 4 values x,y,w,h where w and h are width and height and x and y are 0. I used the exact format for the image upload via multipart...

File Upload and acceptable Error Handling on Undertow/Wildfly wth Spring Boot

java,spring-boot,multipartform-data,undertow
We have a project running on Undertow & SpringBoot and are trying to add File Uploads. The first attempts were successful, the Files have been bound to the appropriate Beans by using the StandardServletMultipartResolver and configuring it using the application.properties. However, we ran into terrible difficulties when it came to...

Adding files to $scope in AngularJS controller

angularjs,angularjs-scope,multipartform-data,form-data
I have the following input element:  <div class="form-group">     <label>Attach BOL Document</label>        <input name="file" type="file" class="form-control" onchange="angular.element(this).scope().uploadFile(this.files)" />  </div> In my controller (outside of any function) I set a variable like this: $scope.fd = new FormData(); and I have the following function defined that fires onchange of the input element as...

Jsonobject + Image Multipart AFNetworking

ios,objective-c,afnetworking,multipartform-data
We are trying to send multi-part request to server using AFNetworking. We need to send one json object and two image files. Following is the curl request for same. curl -X POST http://localhost:8080/Circle/restapi/offer/add -H "Content-Type: multipart/form-data" -F "offerDTO={"code": null,"name": "Merry X'Mas - 1","remark": "25% discount on every purchase","validityDate": "22-12-2014","domainCode": "DO...

'system.argumentexception' When uploading multipart

c#,windows-phone,multipartform-data,dotnet-httpclient
I am trying to post multipart data using System.Net.Http.HttpClient but when I am instanciating my content I am getting this exception: A first chance exception of type 'System.ArgumentException' occurred in System.Net.Http.DLL An exception of type 'System.ArgumentException' occurred in System.Net.Http.DLL and wasn't handled before a managed/native boundary e: System.ArgumentException: The format...

Java MultiPart post

java,multipartform-data
I am trying to create a multipart post to a URL with the following body: Content-Disposition: form-data; name="json" Content-Type: "application/json; charset=UTF-8" {"input1":"data1","input2":"data2","input3":"data3"} --APIMultipartPost Content-Disposition: form-data; name="filePath"; filename="myFile.dat" Content-Length: 381645 Content-Type: text/plain Content-Transfer-Encoding: binary <!-- SNIP --> <!-- The OWL file was included here in plain text (without the SNIPs) -->...