I need to import some files from a local folder from an html page (using js or html5).
Is it possible to do that?
Now I am using tha input='file'
but I want to avoid the user to select the folder. (the files are alsways at the same path).

- 822
- 4
- 19
- 37
-
Upload that necessary files to server and load them from there. (Or check out this thread: http://stackoverflow.com/q/10752055/669677) – Aug 27 '14 at 07:17
2 Answers
No, not without HTML5.
What you need multifile-upload, and that's only supported in HTML5, which isn't exactly supported by all Browsers out there (i.e. IE9).
However, you can use Flash when HTML5 is not supported.
For example Uploadify
Or you can use Yahoo's YUI Uploader.
HTML5 multifile-upload is simple:
<form action="demo_form.asp">
Select images: <input type="file" name="img" multiple>
<input type="submit">
</form>
However, that leaves you with no real Progress indication while the files are uploaded, I'd therefore use some plugin, for example jQUery. See here.

- 78,642
- 66
- 377
- 442
Due to security constraints, any file upload from user system needs to have a user intervention. Think of a situation in which you visit a page and it automatically upload all files from your Document Folder. This will be a big security issue.
A workaround could be using File System API in which your app can ready write and update data in a sandboxed local file system. This area will not be accessible from outside the app.
Other option is to create Chrome and Firefox apps as they might have permission to do it.

- 1,078
- 2
- 8
- 18