Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
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 1-Jun-12 2:14am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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[^]
  Permalink  
v2
Comments
Prasad_Kulkarni at 1-Jun-12 7:34am
   
Good link +5!
I din't got this link..
shivprasadshetty at 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 at 1-Jun-12 8:10am
   
This might be a simple question though
Sounds rude!
Tim Corey at 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 at 1-Jun-12 8:01am
   
SharpZilLib have ablity to compress multiple folders in parent.
shivprasadshetty at 1-Jun-12 9:36am
   
Thanks a lot Oleksandr and Tim
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  

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

  Print Answers RSS
0 Maciej Los 580
1 OriginalGriff 420
2 Sascha Lefévre 289
3 Abhinav S 220
4 CHill60 200
0 Sergey Alexandrovich Kryukov 9,773
1 OriginalGriff 9,290
2 Peter Leow 5,137
3 Kornfeld Eliyahu Peter 3,373
4 Maciej Los 3,036


Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 1 Jun 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100