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
  • There are various ready-made plugins on doing file upload for jQuery. Doing this kind of uploading hacks is not an enjoyable experience, so people enjoy using ready-made solutions. Here's few: - JQuery File Uploader - Multiple File Upload Plugin - Mini Multiple File Upload - jQuery File Upload You can search for more projects on NPM (using "jquery-plugin" as the keyword) or on Github.
    – Cheery
    Commented Oct 15, 2008 at 10:35
  • 78
    you are only getting the file name because your var filename is getting the value of $('#file'), not the file that lies in the input
    – Jimmy
    Commented Nov 3, 2009 at 16:01
  • 22
    Here's a good one: http://blueimp.github.io/jQuery-File-Upload/ - HTML5 ajax uploading - Graceful fallback to iframes for unsupported browsers - Multi-file async upload We've used it and it works great. (Documentation here) Commented Apr 12, 2013 at 18:35
  • 3
    Check also this: stackoverflow.com/questions/6974684/…, here it explains how to achieve it via jQuery Commented Jan 15, 2014 at 12:09
  • 2
    @Jimmy How would he get the get the file that lies in the input instead?
    – alex
    Commented Dec 5, 2014 at 18:05