Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zipping files in ASP.NET without using free third-party solutions

Do C# support zipping multiple files without using free third-party solutions. I knew there are some third-party solutions such as DotNet zip, SharpZipLib etc... did this, but I would like to create a one without using any of the above.

I see using J# (vjslib.dll) we can use GZip but J# is currently retired and not included in VS2010.

Can you point me to the correct place of this implementation?

like image 658
ary Avatar asked Dec 13 '22 02:12

ary


2 Answers

There is always System.IO.Compression which features a class called GZipStream. The ability to write real *.zip files will only be added in .NET 4.5 (see System.IO.Compression in 4.5).

So for now you can either try to write your own implementation (not recommended) or use a third-party component. Depending on the license of the component, you might be able to copy its code into your project (making patches to the component a bit cumbersome). The GPL for instance only requires you to release your source code when you distribute your derivative work. But in the case of a web application where no code or binary is actually given away, there are no consequences to using a GPL-ed library.

like image 199
Christian Klauser Avatar answered Dec 14 '22 16:12

Christian Klauser


If at any point your mind changes and you want free third party option i guess this the the best you can get.

http://dotnetzip.codeplex.com/

like image 36
Nikhil Agrawal Avatar answered Dec 14 '22 14:12

Nikhil Agrawal