How to pull multiple files using FileSystem Api (Html5) and send to javascript as an array. Actual开发者_如何学Pythonly I'm trying to select multiple files and add them to my slideshow.
Any help would be appreciated.
Regards --A.J
You need to add the multiple
attribute to your input
<input type="file" multiple />
You can also add webkitdirectory
, directory
, and/or mozdirectory
to specify you want to allow users to upload entire folders. These are not standard, obviously (although plain ol' directory
is/may be)
Then in your JavaScript, your input element will have a files
array containing meta info on the selected files, ripe for using in the FileReader API. For example:
<input type="file" multiple onchange="doSomethingWithThese(this.files)" />
(I don't recommend the inline JavaScript, just for example)
精彩评论