1

I am trying to get local folder contents using JavaScript. I have tried the Filesystem API, but I got error like this:

DOMException: It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources

How can I get images in a local folder and show these images as HTML? Folder structure and images inside a folder are changing dynamically.

Edit: I tried the filesystem here: https://github.com/maciel310/angular-filesystem

4
  • 1
    Is the page being served locally? Are you asking the end user to drag a folder into the page, or are you trying to access the contents of their hard drive without their intervention? Commented Jan 20, 2017 at 16:57
  • By "being served locally," I mean you are accessing it from a file: URI, not from http://localhost. Commented Jan 20, 2017 at 17:05
  • I tried both file:URI and localhost, but I got the same error. Commented Jan 20, 2017 at 17:10
  • What about the second half of the question? Is the user dragging a folder into your web application? If not, do you understand why it's a grave security problem to allow web applications unfettered access to a user's local disks? Commented Jan 20, 2017 at 18:03

1 Answer 1

3

FileSystem API is currently being supported only on Chrome and Opera http://caniuse.com/#feat=filesystem

Also you need to obtain permissions from the user to access peristent data.

For more info refer to this article : https://www.html5rocks.com/en/tutorials/file/filesystem/#Reading a directory's contents

Sign up to request clarification or add additional context in comments.

1 Comment

But before this is standardized, don't use it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.