0

Obviously, JavaScript itself cannot access the filesystem. Thank goodness.

But Flash, Java and other plugins can, and they can communicate with JS.

So, let's say I wanted to make a page where the user selects a directory on their own computer, and it reads the folder for song files and makes a playlist out of them using HTML5 audio.

What would be the best way of going about getting the contents of a folder?

Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592
  • https://developer.mozilla.org/en/Using_files_from_web_applications might help – jimw Apr 15 '12 at 23:48
  • You can actually access file system with javascript now, not in all browsers, but can, google for `javascript file api` – Roman Pominov Apr 15 '12 at 23:50
  • Depending on what browser (and version) you'r using you can probably do it (file/folder read) without any extra plugins as its part of HTML5 [link](http://www.html5rocks.com/en/features/file_access) – NickSlash Apr 15 '12 at 23:53
  • 1
    See answers in http://stackoverflow.com/questions/1087246/can-javascript-access-a-filesystem – Seth Flowers Apr 15 '12 at 23:54

1 Answers1

0

Neither Java nor Flash are available in all environments. So you will have to use feature detection.

I for myselft would first look for JS file api, then ActiveX to include poor MSIE users, and screw the rest cause I don't like Java and don't know about flash :)

Bergi
  • 630,263
  • 148
  • 957
  • 1,375