Solved

Downloading multiple files

Posted on 2004-03-22
5
316 Views
Last Modified: 2010-04-01
Hello experts,

I have a JSP that lets users to check box multiple images and then save them to their local machine after clicking on a "submit" button. I am wondering what is the best way to handle it, right now my code can only download 1 file. I am trying to avoid having the user selecting the destination location for saving for every files checked. It would be great if the user select the location once, then all checked files will be saved there.

Right now, my code only works for 1 single (the first one), so only one file is stored now even the user checked 2.

Thanks

Stephen
0
Comment
Question by:autoknowledge
  • 3
5 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 100 total points
ID: 10652131
If you use a ZipOutputStream, you can read the files in one by one, and call addEntry() to add the files to a single zip file on the fly.  Then the user can unzip the file to get at the files they selected...

Other than this, I can't think of another way :-/

Sorry I can't post any code, this isn't my PC :-(

Good luck!!

Tim
0
 

Author Comment

by:autoknowledge
ID: 10652334
Instead of making a zip file, is it possible to create a directory and in the loop I put all files in that directory and the user only need to select the saving location plus the directory name??

Stephen
0
 
LVL 35

Expert Comment

by:TimYates
ID: 10652805
no :-(
0
 
LVL 35

Expert Comment

by:TimYates
ID: 10652812
Well, you could, with a signed Java applet, or a signed ActiveX control, but with just HTML and JSP and browsers...no :-(
0
 

Expert Comment

by:dhanyaknair
ID: 10831576
Hey Stephen/TimYates

I want the same thing.(JSP running in server that lets users to check box multiple images and then save them to their local machine after clicking on a "submit" button.)
Did you manage to acheive it?
Can you helpme out with some code?

Its urgent.

Regards,
Dhanya
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
maven scope 1 127
Lamba in java 8 9 239
how to exclude a file using regex 5 117
struts exact match support 3 51
There are many Password Managers (PM) out there to choose from. PM's can help with your password habits and routines, but they should not be a crutch you rely on too heavily. I also have an article for company/enterprise PM's.
Note: This is the second blog post in a series on email clearinghouses (https://www.xmatters.com/alert-management/blog-email-has-failed-us?utm_campaign=70138000000ydLoAAI&utm_source=exex&utm_medium=article&utm_content=blog-post).   Every month t…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now