On Aug 14, 12:55 am, hubbs <[EMAIL PROTECTED]> wrote:
> I am working on a page that has multiple file uploads, and the user
> can add more if they need to.  To submit it to the server, I need to
> send them one at a time, so I was thinking I could use the .each()
> function to loop through the file input fields that have been added,
> and submit each one separately, maybe using the form plugin.
>
> I know how I would do it if I could submit it using ajax, but I know
> files cannot be submitted using ajax.
>
> Here is how I would do it using ajax:
>
> $("#adminToolsListing :file").each(function() {
>                 // Pass the values to ajax post
>                 $.ajax({
>                     type: "POST",
>                     url: this.value
>                 });
>             });
>
> Would something like this be possible, but using a normal form submit,
> and returning the server response each time?

You can't submit files via ajax but if each file input were in its own
form you could iterate them and submit them with the Form Plugin's
ajaxSubmit function.   Seems like an odd thing to do though.  If you
doing that just to provide feedback you may want to look at the
jqUploader plugin:

http://www.pixeline.be/experiments/jqUploader/

Mike

Reply via email to