简体   繁体   中英

How to use BlueImp jquery-file-upload to pass parameters using send option

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}]

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM