Forum Moderators: open
Very simply - Is it possible to read the contents of a local directory using javascript?
I need to to automatically fill in a load of file fields for quicker uploading of multiple files.
eg. user searches for file, selects it, then hits a button and all other files in that folder are parsed and populate the other file inputs.
Hope that makes sense,
Hughie
What I do with these is set in another page prior to the upload with an option list. "Select how many images you plan to upload." As one who tries to eliminate as many clicks and pages as possible, I feel like it's a compromise but necessary.
I suppose you could do the same thing on a single page with Javascript by using document.write() to a div, but then it becomes Javascript-dependent.
In some cases i needed to upload 100 images with the same database attributes, but different filename, so it was just a boring job that could be made a lot simpler with a "select all" function.
If this is to be hosted and use the http:// or similar protocol, then you need the user's permission to elevate the privileges of the script so it can access local directories.
See Mozilla's Javascript Signed Scripts [mozilla.org] for more.