Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • 4
    I have the file part working ... but can you include text fields in this as well? This doesn't seem to with var formData = new FormData($('form')[0]); or serialize() ?
    – Dan
    Commented Jun 5, 2012 at 4:26
  • 18
    Can I then use $_FILES in the upload.php? Commented Nov 2, 2012 at 13:41
  • 74
    This should work in Internet Explorer but only Version 10. (caniuse.com/xhr2)
    – Tyler
    Commented Jan 2, 2013 at 16:33
  • 20
    Hi, I appreciate PHP is your language of choice... but I am wondering if you know if this also works in ASP.NET MVC? I am a .NET developer and I have tried to utilize your simple example to do some AJAX file uploading but server side I do not get the file I posted via AJAX. I am using latest Chrome.
    – Shumii
    Commented Jun 1, 2013 at 5:29
  • 29
    It's FormData who does all the magic here. Be sure to check these docs — it covers all your question about multiple files and fields. Commented Sep 12, 2013 at 13:26