Questions tagged [dotnetzip]

Questions dealing with the DotNetZip open-source zip library for .NET

DotNetZip is an open source zip library. DotNetZip works on PCs with the full .NET Framework, and also runs on mobile devices that use the .NET Compact Framework. Silverlight is also supported.

Below is an example of using the library with C#:

 using (ZipFile zip = new ZipFile())
 {
     // add this map file into the "images" directory in the zip archive
     zip.AddFile("c:\\images\\personal\\7440-N49th.png", "images");
     // add the report into a different directory in the archive
     zip.AddFile("c:\\Reports\\2008-Regional-Sales-Report.pdf", "files");
     zip.AddFile("ReadMe.txt");
     zip.Save("MyZipFile.zip");
 }

Note: Just for reference the project builds into Ionic.Zip.dll

Installation

DotNetZip can most easily be installed through its NuGet package.

Install-Package DotNetZip
460 questions
4
votes
2 answers

decompress deflate64

I've got a compressed string of bytes coming out of a database which I need to decompress so as to retrieve the rtf file in there. This is the requirement. I tried to use DotNetZip and it has given me a 50% success ratio. The failed 50% gave me a…
Joe
  • 11,147
  • 7
  • 49
  • 60
4
votes
3 answers

unzip password protected file

how to unzip a password protected file using dotnetzip or sharpziplib (if the password is not known).
Niraj Choubey
  • 3,942
  • 18
  • 58
  • 93
4
votes
1 answer

DotNetZip unable to zip a huge number of entries

I'm using dotnet zip in the following way: using (ZipFile zip = new ZipFile(@"E:\test2.zip")) { zip.ParallelDeflateThreshold = -1; zip.UseZip64WhenSaving = Zip64Option.Always; zip.SaveProgress += SaveProgress; …
user2878881
  • 307
  • 4
  • 13
4
votes
1 answer

DotNetZip check if folder exists in zip file

I am trying to check if a folder exists in a zip file. The code is following: //All entries refered too exists. //For files (Workes fine, returns true) var hello1 = zip.Any(entry => entry.FileName.Equals(@"Patients.xml")); var hello2 = zip.Any(entry…
MasterXD
  • 804
  • 1
  • 11
  • 18
4
votes
2 answers

Exception thrown by target of invocation in BackgroundWorker

I have the following code: public void extractZipFile() { if (!System.IO.Directory.Exists(extractDirectory)) System.IO.Directory.CreateDirectory(extractDirectory); BackgroundWorker worker = new BackgroundWorker(); …
davidweitzenfeld
  • 1,021
  • 2
  • 15
  • 38
4
votes
2 answers

Compress file with dotnetzip, and when open it is corrupted

I create a zip file in a controller from a byte array and I return the zip file as a fileresult. When I download the zip File and extract the file, it is corrupt. I'm doing it this way: byte[] fileBytes =array MemoryStream fileStream = new…
user1957868
  • 41
  • 1
  • 3
4
votes
2 answers

How to find uncompressed size of ionic zip file

I have a zip file compressed using Ionic zip. Before extracting I need to verify the available disk space. But how do I find the uncompressed size before hand? Is there any header information in the zip file (by ionic) so that I can read it?
nawfal
  • 70,104
  • 56
  • 326
  • 368
4
votes
1 answer

DotNetZip Creates corrupt archives (bad CRC)

There's a strange problem with DotNetZip that I can't seem to find a solution to. I've searched for a few hours now and I just can't find anything on this, so here goes. var ms = new MemoryStream(); using (var archive = new Ionic.Zip.ZipFile()) { …
Heki
  • 926
  • 2
  • 15
  • 34
3
votes
1 answer

DotNetZip streaming

I'm trying to zip a bunch of files and make the data consumable via a stream. I would like to keep the memory footprint as small as possible. My idea was to implement a Stream where I've got a bunch of FileStream objects as data members. When the…
Jordan
  • 1,599
  • 4
  • 26
  • 42
3
votes
3 answers

DotNetZip creating zip from subset of other zip

I have a big zipfile that I need to split in multiple zip files. In the method I'm now creating I have a List object. This is the code I have got: //All files have the same basefilename/ string basefilename =…
Patrick
  • 2,730
  • 4
  • 33
  • 55
3
votes
1 answer

DotNetZip Library: creating split Archive - System.UnauthorizedAccessException

Wehen i set the zip.MaxOutputSegmentSize high enough so there would be only one zip file it works. As soon as i limit the MaxOutputSegmentSize i get this error after one of the split files reaches its max size - when i have a value like 20MB it…
ThomasK
  • 41
  • 1
  • 6
3
votes
4 answers

C# WPF Detecting Extract Completion with DotNetZip?

I've been trying to work with Ionic.Zip (DotNetZip) for extracting downloaded zip files through a program. But I'm stuck when trying to detect when the Extraction process as completed. The library contains a ExtractProgress event, so I tried to…
Dan
  • 73
  • 2
  • 4
3
votes
1 answer

Cannot decompress ZLIB/DEFLATE data

I'm trying to extract data from compressed bytes from network capture file (PCAP.) Data from some of these packets don't have ZLIB header (the first 2 bytes, where lower 4 bits of first byte is always 8) and hence gave exception when I tried to…
Gant
  • 29,661
  • 6
  • 46
  • 65
3
votes
1 answer

Opening Split Zip Files With DotNetZip

I am trying to extract files from zip files using the DotNetZip library. I am able to extract files when it is a single .zip file. However, when I try to extract files from a multi volume zip file like Something.zip.0 or Something.zip.1, I get the…
riteshkp
  • 31
  • 4
3
votes
4 answers

Zip a Folder Created in C#

I'm creating a folder in C# and I'm hoping to zip it up as soon as I've created it. I've had a look around (How to zip a folder), (http://dotnetzip.codeplex.com/) but no luck so far. I'm a bit apprehensive of using dotnetzip as it's last release was…
CBreeze
  • 2,925
  • 4
  • 38
  • 93