I am trying to upload multiple files in the same form. Multiple files should be in different fields. I used ajaxfileuploader for single file and receive it using MultipartHttpServletRequest. And it was successful.
I used
$.ajaxFileUpload
(
{
url: 'uploadfile',
secureuri: false,
fileElementId:'setup',
dataType: 'text',
data: { id: id },
success: function (data, status) {
if (status == 'success') {
return;
} else {
}
},
error: function (data, status, e) {
return alert('Error ! Failed to upload file!');
}
}
)
But my problem is I have many files to be uploaded by single request. For example setup1,setup2,setup3 (different ids). How to give multiple ids on ajaxFileUpload? Your kind reply is appreciated
Thank you
You can wrap that code in a function and call it multiple times since the plugin doesn't support multiple elements in once request
Then use it this way
Consider to use this JQuery plugin for multiUpload. http://hayageek.com/docs/jquery-upload-file.php