1

I know there are other question like this around, but the solutions are not working for me. Can someone help me figure out how pass parameters using a POST request with the jquery-file-upload library, specifically when the send option is being used:

$('#fileupload').fileupload('send', {files: [file]} )
.success(function (result, textStatus, jqXHR) {
    console.log("Success...");
});  

I've tried the following:

$('#fileupload').fileupload('send', {
    files: [file], 
    formData: {'fileType': fileType}
})

and also:

$('#fileupload').fileupload({formData: {'fileType': fileType} });
$('#fileupload').fileupload('send', {files: [file]})

and I've tried putting formData in the format of formData: [{name:'fileType', value:fileType}]

RTF
  • 6,214
  • 12
  • 64
  • 132

1 Answers1

1

I had same problem a few minutes ago. You should use :

file_upload.fileupload('send', {files:filesList, paramName: paramNames});

I found it here: Uploading multiple files asynchronously by blueimp jquery-fileupload

Community
  • 1
  • 1
bro
  • 11
  • 1
  • Thanks, that looks useful, but it still doesn't work for me. paramNames seems to be just an array containing the param names, what about the values? – RTF Apr 27 '14 at 19:07
  • 1
    I don't have anything better than [How-to-submit-additional-form-data](https://github.com/blueimp/jQuery-File-Upload/wiki/How-to-submit-additional-form-data). paramNames helped me with wrong field names when multiple files are send in single request. – bro Apr 27 '14 at 20:36
  • I've read through it already and unfortunately it didn't help me. Thanks anyway – RTF Apr 27 '14 at 20:38