Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to allow user to browse/provide local folder location/path for download  RSS feed

 
Rama Krishna
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"radkrin",
Please check your private messages.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This isn't something you do with in JavaScript.

If you set the Content-Type header to a value for which the browser dosen't have an association, it will automatically prompt the user with a Save or Open With dialog box.

Also, if you set the Content-Disposition header to "attachment", the browser will prompt the user to either open the application with the associated application (if there is one) or save it to disk.

In both cases the user will be given a dialog box that allows them to pick the location on their hard drive to which the file will be saved.
 
Rama Krishna
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunatley, I have many files that will be downloaded in a single click. Do you think this will still solve the problem? So this is still an unsolved problem!

Any other technology I can quickly use, like a script that I can borrow, copy paste and starting using?
[ January 27, 2008: Message edited by: Struts Krishna ]
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem of downloading many files in one step can be (more or less) solved by zipping them together into one file for download. Just about every client system can handle .zip files.

As Ben said, neither JSP nor JavaScript can specify the location where a downloaded file will end up. The user can set that in the browser, or in the file save dialog if one is shown. There's nothing the application can do about it.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Struts Krishna", you have previously been warned on multiple occasions regarding adjusting your display name to meet JavaRanch standards. This is not optional, and this is your final warning. Adjust your display name to comply with the required standards prior to your next post.

Your name must not be obviously fictitious!

Failure to comply will result in the removal of your account.

bear
JavaRanch Sheriff
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!