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
11
votes
2 answers

How to UnZip downloaded Zip file in Xamarin forms

In my application I am getting ZIP file with 4 pdf documents during My API call. I am saving the ZIP file using the below code. var rootFolder = FileSystem.Current.LocalStorage; var file = await rootFolder.CreateFileAsync(fileName,…
StezPet
  • 2,430
  • 2
  • 27
  • 49
11
votes
4 answers

DotNetZip: How to extract files, but ignoring the path in the zipfile?

Trying to extract files to a given folder ignoring the path in the zipfile but there doesn't seem to be a way. This seems a fairly basic requirement given all the other good stuff implemented in there. What am i missing ? code is - using…
Kumar
  • 10,997
  • 13
  • 84
  • 134
10
votes
1 answer

How to tell if a byte array is gzipped

How can I see if a byte array contains a gzip stream? My application gets files from other applications through http post with Base64 encoding. Depending on the implementation of the application that delivers the files, the byte array that comes out…
Kees
  • 1,408
  • 1
  • 15
  • 27
10
votes
2 answers

How to handle unzipping ZipFile with paths that are too long/duplicate

When unzipping files in Windows, I'll occasionally have problems with paths that are too long for Windows (but okay in the original OS that created the file). that are "duplicate" due to case-insensitivity Using DotNetZip, the…
gameweld
  • 1,319
  • 15
  • 21
8
votes
2 answers

Ionic Zip : Zip file creation from byte[]

Ionic zip allows me to add existing file to zip object and create a zip file. But considering that I am reading those byte[] from created zip file and sending over server, I need to again create zip file from that byte[] to store zip on server. How…
Cannon
  • 2,725
  • 10
  • 45
  • 86
8
votes
2 answers

Unzipped data being padded with '\0' when using DotNetZip and MemoryStream

I'm trying to zip and unzip data in memory (so, I cannot use FileSystem), and in my sample below when the data is unzipped it has a kind of padding ('\0' chars) at the end of my original data. What am I doing wrong ? [Test] public void…
Luciano
  • 2,695
  • 6
  • 38
  • 53
8
votes
1 answer

Compression fails when using ionic zip

I am using the latest version of ionic zip version 1.9.1.8.I have set the property of ionic zip ParallelDeflateThreshold = 0. The zipping mechanism was working perfectly for the past two months.Suddenly this stopped working.The zipping thread just…
Techy
  • 315
  • 1
  • 5
  • 14
7
votes
2 answers

Creating a zip file in situ within azure blob storage

I have files stored in one container within a blob storage account. I need to create a zip file in a second container containing the files from the first container. I have a solution that works using a worker role and DotNetZip but because the zip…
Digbyswift
  • 10,310
  • 4
  • 38
  • 66
7
votes
1 answer

DotNetZip ExtractProgress Bug?

The ExtractProgressEventArgs.EntriesTotal and ExtractProgressEventArgs.EntriesExtracted is always zero. Is this a known bug? See my code below: public static void UnZip(string zipFile, string destination) { using(ZipFile zip =…
Ian
  • 5,625
  • 11
  • 57
  • 93
7
votes
1 answer

Why can't Windows 7 extract files from my password protected zip-file created using DotNetZip?

I'm creating a password protected zip-file using DotNetZip. When I try to extract the files I'm met with an "unspecified error". Why is that? using (var zipFile = new ZipFile()) { zipFile.Encryption = EncryptionAlgorithm.WinZipAes256; …
J. Steen
  • 15,470
  • 15
  • 56
  • 63
7
votes
2 answers

DotNetZip - Calculate final zip size before calling Save(stream) in C#

When using DotNetZip, is it possible to get what the final zip file size will be before calling Save(stream)? I have a application(Window Service) where package Stream size is more than 100MB then package will saved and upcoming files add into new…
Saroop Trivedi
  • 2,245
  • 6
  • 31
  • 49
6
votes
2 answers

How to validate multi part compressed (i.e zip) files have all parts or not in C#?

I want to validate multipart compressed files like Zip because when any part missing for compressed files then it raises an error, but I want to validate it before extraction and different software creates a different naming structure. I also refer…
Hiren Jasani
  • 258
  • 2
  • 13
6
votes
0 answers

Encrypt file names in archives, prevent showing content list with ionic.zip in c#

I know zipping files with ionic.zip like here: using (var zip = new ZipFile()) { zip.Encryption = EncryptionAlgorithm.WinZipAes256; zip.Password = "123"; zip.AddDirectory("/path/"); zip.SaveProgress += Zip_ProgressBar; …
Habip Oğuz
  • 921
  • 5
  • 17
6
votes
3 answers

Is there a zip library for c# that is faster than DotNetZip

I m currently using Ionic zip library. I was curious if there s a faster one than this? As long as it has a faster compression algorithm, i dont care what it uses.
DarthVader
  • 52,984
  • 76
  • 209
  • 300
6
votes
1 answer

Convert DotNetZip ZipFile to byte array

I've built a DotNetZip ZipFile with several entries. I'd like to convert it to a byte array so I can download it using the download construct below. Using wrkZip As New ZipFile '----- create zip, add memory stream---------- For n…
wayfarer
  • 780
  • 2
  • 15
  • 33
1
2
3
30 31