Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2005

Tip: Looking for answers? Try searching our database.

Multiple files download: Is there a way?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stanav - 29 Oct 2005 02:25 GMT
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.
Peter Rilling - 29 Oct 2005 06:03 GMT
How about packaging the files in a zip and then having the client download
that file?

> Hello all,
>
[quoted text clipped - 18 lines]
>
> Stanav.
Steve C. Orr [MVP, MCSD] - 29 Oct 2005 06:40 GMT
Yes, I agree you should zip the files into a single file.

I've heard of people having success with this code:
http://www.icsharpcode.net/Ope­nSource/SharpZipLib/Default.as­px

Or you could consider calling a command line utility like this:
http://www.i386.info/software/­zip23xn.zip

Or you could consider a 3rd party component such as this:
http://www.xceedsoft.com/products/zipnet

Signature

I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

> How about packaging the files in a zip and then having the client download
> that file?
[quoted text clipped - 21 lines]
>>
>> Stanav.
Stanav - 29 Oct 2005 15:06 GMT
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.

> Yes, I agree you should zip the files into a single file.
>
[quoted text clipped - 32 lines]
>>>
>>> Stanav.
Steve C. Orr [MVP, MCSD] - 29 Oct 2005 22:49 GMT
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.

Signature

I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

> Thank you for replying, Peter & Steve...
> I have thought about zipping all the user selected files into a single
[quoted text clipped - 50 lines]
>>>>
>>>> Stanav.
Eliyahu Goldin - 30 Oct 2005 09:15 GMT
Stanav,

See if this can help you:

http://the-stickman.com/web-development/javascript/upload-multiple-files-with-a-
single-file-element/


Eliyahu

> Hello all,
>
[quoted text clipped - 17 lines]
>
> Stanav.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.