Click here to Skip to main content
16,017,857 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have a folder that is created by some service.
It contains multiple sub-folders.
I want to give the provision to the users of a website to download the entire folder as a single zip file without needing to create and store the zip file in the system.
That is create a temporary zip file and push it to the user.

Thanks in advance.
Posted

I believe this article will give you exactly what you are looking for: http://www.4guysfromrolla.com/articles/092910-1.aspx[^]

Right now I believe you still have to use that third party library but in .NET 4.5, you can do this without a library because it is built in. I did an article on zip files in .NET 4.5 recently, although I didn't discuss the web side of things. It might be of use to you in your planning, depending on if you want to use the latest version of .NET or not. Here is a link to the article, in case you are interested: Creating Zip Files Easily in .NET 4.5[^]
 
Share this answer
 
v2
Comments
Prasad_Kulkarni 1-Jun-12 7:34am    
Good link +5!
I din't got this link..
[no name] 1-Jun-12 7:48am    
Yes this one is working pretty fine but my folder has multiple folders in it and how to add those folder to zip??
This might be a simple question though
Prasad_Kulkarni 1-Jun-12 8:10am    
This might be a simple question though
Sounds rude!
Tim Corey 1-Jun-12 8:37am    
You can just add the root folder and all the folders underneath will be added (or each root folder if there are multiple in the root directory). There is documentation on how to add a folder, but here is a quick example I found: http://c-madeeasy.blogspot.com/2011/10/using-dotnetzip-to-compress-all-files.html
Oleksandr Kulchytskyi 1-Jun-12 8:01am    
SharpZilLib have ablity to compress multiple folders in parent.
Hi.
You might look forward to SharpZipLib i think with help of this library you could compress entire folder with subfolders and files.
Good luck.
 
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