Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI All,

I am uploading local system file to server and I am storing in server's folder. I am displaying file name in gridview Now I want to download multiple file by selecting checkboxes based on that I want download files from server to local system. I am able donwload single file at a time but I want to download multiple files from server to local system.

I will be waiting for your reply.

Thanks
PBN
Posted

There is only one way mate, you are gonna have to zip them up on server side and then download the zip file.

You can try this SharpZipLib[^] which is an open source archiving library for C#.

Essentially, the following steps should be followed:

1) Add each item from the grid i.e. filename to a list as you check them one by one.
2) For each filename, prefix it with the base path (on your server) and using ZipLib add it to an archive file i.e. a zip.
3) finally, save zip file to the disk.
4) Redirect the client to the location of the zip file and browser will take care of the rest.

I know its not full code but you will rarely get full code on CP, unless its quite small. But this should give u an approach.
 
Share this answer
 
Check out the multiDownload jquery plugin: http://biesiad.github.com/multiDownload/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900