Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
28
rated 0 times [  29] [ 1]  / answers: 1 / hits: 21120  / 11 Years ago, tue, march 26, 2013, 12:00:00

I need to use the formData parameter available in the jQuery File Upload control to send additional data to the server on submit. The default implementation for formData is to invoke a function that grabs all controls in the form and serializes them to an array (using the jQuery serializeArray() method).



I have controls in my form, but when the file is uploaded, I am not getting any additional data. When I inspect via Fiddler, there is nothing in the request that shows these form fields are being submitted.



Is there something additional that needs to be done to get these to submit?



Btw, these two links discuss formData...



https://github.com/blueimp/jQuery-File-Upload/wiki/Submit-files-asynchronously
https://github.com/blueimp/jQuery-File-Upload/wiki/Options
...for this one search the page for formData.



For what its worth, the multipart option is set to true.


More From » jquery

 Answers
11

I also needed to pass an extra parameter and here is what i used :



$('#fileupload').fileupload({
formData: {
param1: 'test'
,param2: value2
,param3: yasseshaikh
}
});


The formData option can be used to set additional form data programmatically.


[#79333] Tuesday, March 26, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aleighabayleef

Total Points: 511
Total Questions: 99
Total Answers: 99

Location: Aruba
Member since Fri, Jun 24, 2022
2 Years ago
;