jgille07
jgille07

Reputation: 229

HTML5 FileSystem API List Files in Directory Simple Example

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

Answers (2)

user3573790
user3573790

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

Offbeatmammal
Offbeatmammal

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

Related Questions