Mass File Upload Using HTML 5 and JavaScript
This page demonstrates how to upload a large number of files from a browser to a server. It works in Chrome
and Firefox browsers. There are two tricks in use:
- In Chrome, a file input field with
webkitdirectory
attribute can select a whole directory,
while in Firefox, a file input field with multiple
attribute can select multiple files.
- The XmlHttpRequest object in JavaScript allows to select any files
from the selection and upload them using HTTP POST while displaying a progress meter.
My code was inspired by How do I use Google Chrome 11's upload folder feature
in my onw code ? and HTML5 FIle Upload with progress articles.
Here is the form:
Select a directory (in Chrome) or multiple files (in Firefox):