Download jquery file send all files in one message

I am using jquery file upload. I use it for several pages in a project. For one project, I need to upload all the files in one request, because I loop through all the images, and after that a dossier is created and closed. I think it's faster to send all images at once, instead of changing the server-side handler. The only thing I can not bring them together. I based the singleFileUploads option, it works, but only if you select all the files at once. If you drag 2 times, it still loads into 2 messages (and it does 2 dossiers.

I read the documentation ( https://github.com/blueimp/jQuery-File-Upload ), but cannot find out how to make it work. (I know this is a plugin specifically for multiple posts)

So basically, my question is: does anyone know how to get the inserted files before downloading so that I can group and serialize them.

Thnx,

+6
source share
2 answers

This post may help you:

Multiple File Upload Inputs

Unfortunately, it does not support IE. But there is still a Flash plugin (free) that can do this, of course, it also supports multiple browsers.

Check it out: Demos - Uploadify

0
source

You can upload your files while submitting the form.

var submitFormData = true; $('#fileFieldId').fileupload({ dataType : 'json', autoUpload : false, add : function(e, imageData){ $("#yourFormId").on("subimt",function(){ if(sendData){ imageData.formData = $("#yourFormId").serializeArray(); submitFormData = false; } imageData.submit(); }); }, done: function(e,data){ submitFormData = true; } }); 
0
source

Source: https://habr.com/ru/post/976418/


All Articles