Reputation: 229
Could anyone provide me with a very basic example of how to list the files located in a local directory using the HTML5 FileSystem API? I would like to be able to use an HTML input element of type "file" to select which directory's content is listed off. I tried using the example from the link below, but it did not work (screen was blank and nothing was listed).
http://www.html5rocks.com/en/tutorials/file/dndfiles/
Any advice would be greatly appreciated.
Upvotes: 0
Views: 15673
Reputation: 11
Just add some attribute to your input tag!
Ex:
< input type="file" id="files" name="files[]" multiple webkitdirectory="" directory=""/ >
Then you can see what content is in this folder.
Upvotes: 1
Reputation: 8228
This question - Get metadata of local mp3 file using html5 filesystem api - has a simple example that lists all the files in a specified directory. The HTML5 Rocks sample appeared to only be matching/outputting on specific file types, which was possibly why you saw an empty result
Upvotes: 0