Asynchronously upload multiple files with one HTTP POST - ajax

Is it possible to asynchronously upload multiples files in the same HTTP Post request?
Basically, Can I append multiple files to FormData, and then submit all of it asynchronously at one time?
The blue-imp plugin I am using for file uploads is good, but it submits each file in a separate POST request. I just want one request ideally.
Thanks

There is a free control available called Uploadify which will help you in doing in this functionality.
You'll either have to use HTML5 or flash for achieving this kind of functionality.
http://www.uploadify.com/

Related

Ajax - Upload multiple files in one request using multipart form-data

what is the best plugin to upload multiple files in one request using multi-part form-data in ajax?
I am trying to upload multiple files in one server call using ajax.
but could not find the plugin to satisfy the requirement.
any suggestions or working examples?

how to handle Multiple file upload using spring

I am a newbie to spring and mvc framework.
I am going through the framwork and i wanted to understand the File upload (multiple) and use spring to load my complex object.
I have seen example using MultiPartFile for single file upload.
I tried the same for trying out the multiple file upload but I failed where i tried to make generic (like allowing the user to upload as many files).
Is there a way to do it in a optimal way to have the files available as list in the controller?
Thank you for reading!!!
is there a way to handle this without using multipart resolver?
Take a look at my answer to a similar question here:
Preserving value for <form:input type="file"> with Spring MVC
This explains our approach of an asynchronous file upload handling and processing of them on a final form submit.
I have used jquery.form.js. You can find example using Google. If not you can tell me to post a link. Moreover you should investigate how the browsers will handle the upload process (i.e.

Fine Uploader POST vs PUT Request

Currently, Fine Uploader uses a POST to send the data to the server - is there a way to change this to a PUT in the options object? I'm using backbone.js, and a POST makes a new record, and a PUT triggers an update.
Thanks.
POST is the most appropriate method for an upload request, mostly because file upload requests are intended to be idempotent. PUT request are more appropriate for non-idempotent (update) requests.
However, there is another reason why PUT is not a good choice here: this will not work in IE9 and older. In those browsers, a form is submitted inside of a hidden iframe for each file to be uploaded, due to lack of File API support. There are only two valid values for the method attribute on a <form>: GET and POST. So you'd have to handle POST requests anyway, unless you are not going to support IE9 and older (not likely).
I am familiar with backbone.js, and there is no reason why POST requests cannot be used, especially in this instance. You haven't provided any specific reason why PUT requests are preferable here, so I can only assume that if there is such a requirement, this is likely due to some logic in your application that should probably be re-evaluated.

Multiple files upload in grails

I am trying to implement a comment mechanism in which a user can post a comment and also upload multiple files with it. I am using a g:formRemote for the comment part but I learned that ajax request does not supports file uploads. SO how do I do this? I found few plugins but they did not work for me as I have to save comments as well and these plugins did not support that. I found a way on internet by using iframes, but I am not sure how to do that. Any help would be very appreciated. Thanks
Try to use jQuery Form plugin, it supports ajax file uploads as well so you don't need to implement this by yourself. It also allows to track upload progress.

What is algorithm that shall be added to "comon HTML" file upload server side to make it accept "AJAX"/"HTML5" files Upload?

I wonder what are changes/(steps to make) that are required to implement to server side that allows "comon HTML form" file upload to make it accept HTML5 or AJAX multiple files upload?
None. Any server-side form handler that can accept at least 1 file in a form submission can be used to accept files uploaded via AJAX form submits (you just have to make multiple submits).
Now, there are ways to make server-side form handling more flexible, but you haven't given any details to work with so we have no idea what you are currently doing and therefor have no way to know what might need to be done to improve it.

Resources