Solution to a simple requirement: How to allow user to browse/providelocal folder location/path for

R

Radhey Krishna

A very interesting problem for a simple requirement and not easily
available solution:

How would I create a button which will allow the user to specify where
the file to be downloaded will be saved to??

The actual problem is that I have multiple drop down buttons (for
multiple files) with each of the drop down button containing an option
to save to a local folder. Once the user specifies the local path for
each of these files and clicks the submit button. All of the files
will be saved automatically to these locations.

I thought that this is a simple and decent requirement by the client
but I have found no solutions on the web. So JavaScript developers,
please provide some suggestions on how to access the directory path
string (which will be used to download the file).

Thanks and Regards
RadKri
 
T

Thomas 'PointedEars' Lahn

Radhey said:
How would I create a button which will allow the user to specify where
the file to be downloaded will be saved to??

<form action="file_to_be_downloaded">
<input type="submit" value="Download">
</form>

Or simply set a link. A download dialog will be displayed in either case.
The actual problem is that I have multiple drop down buttons (for
multiple files) with each of the drop down button containing an option to
save to a local folder.

What do you call a "drop down button" anyway?
Once the user specifies the local path for each of these files and clicks
the submit button. All of the files will be saved automatically to these
locations.

This can't be done without additional features that would grant you
permission to write to the local filesystem.
I thought that this is a simple and decent requirement by the client but
I have found no solutions on the web.

That is why you have not found any solutions so far. Access from a Web site
to the local filesystem, especially write access, is a security issue, of
course.
So JavaScript developers, please provide some suggestions on how to
access the directory path string (which will be used to download the
file).

You can't, at least not interoperably.

But AFAIK, all available file download dialogs remember the last selected
directory, so there is not really a need to define the target directory in
advance.

However, if your goal is to save the user the additional trouble of
clicking for each file to be downloaded, why not have a server-side script
create a zipped archive containing the files selected and then have the user
download that archive to the target directory using conventional means?

<form action="zipAll">
<input type="hidden" name="file" value="file1">
<input type="hidden" name="file" value="file2">
<input type="hidden" name="file" value="file3">
<input type="submit" value="Download as zipped archive">
</form>


HTH

PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top