Multiple files download: Is there a way?

S

Stanav

Hello all,

Thanks in advance for any replies...
Now, my question is: Is it possible to do a multiple files download for a
single response event on an aspx page? If there is, please give me some
directions/sample code or anything.
On my web application, I have a CheckBoxList that shows all the files. The
user will check (select) the files to download, then click on the "Download"
button. A SaveAs dialog pops up to allow the user to select the save
location, then all the selected files will be downloaded to the user's PC.
I tried to run a loop through the selected files, but it didn't work (only 1
file gets downloaded).
Any advice?

My second option is to FTP the selected files to the client. However, I
can't find a way to show the SaveAs dialog AND get the returned save path. I
was able to display the SaveAs dialog using java script, but I don't know
how to get the save path from it. I did a lot of Googling but found nothing
for this. Please help....

Stanav.
 
P

Peter Rilling

How about packaging the files in a zip and then having the client download
that file?
 
S

Stanav

Thank you for replying, Peter & Steve...
I have thought about zipping all the user selected files into a single one,
however that would take alot more overhead (copy the files to a temp folder,
zip them, and delete them after the download is done. Also, at the client
side, the user must unzip the file before he could use it... )
Third party components are too expensive for me.... Thus I always try not to
go third party. Besides, the learning is really more important. If I go 3rd
party, I'm not going to learn much how somethining got done.

So, is there a way to get the client's save path in ASP.NET? That is, when
the Save dialog pops up in the browser and the user chooses a location to
save then click OK, instead of doing Response.WriteFile(fileName), I just
want to grap the save path and then FTP the files to that directory at the
client PC...

Thanks again for the responses.
Stanav.
 
S

Steve C. Orr [MVP, MCSD]

There is new improved compression support in the new .NET framework 2.0 so
you don't have to buy a 3rd party component.
System.IO.Compression
More info:
http://www.developer.com/net/net/article.php/3510026

Security restrictions would prevent the design you proposed - direct access
to a user's hard drive is forbidden for web applications, and for good
reasons! The only way you could do that is with a thick client such as an
ActiveX control, which the user would have to accept despite security
warnings.
 

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
474,262
Messages
2,571,059
Members
48,769
Latest member
Clifft

Latest Threads

Top