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
0
votes
1 answer

Not able to compress large file more than 10 GB using DotNetZIP

I am able to compress up to 1 GB of the folder but I have to compress more than 10 GB. string filePath = C:\Work; // path of the source file private void compressFile(string filePath) { using (ZipFile zip = new ZipFile()) { …
Dutt93
  • 118
  • 10
0
votes
0 answers

C# assure that the binFile in zip file is really updated

This question is a follow up question of Read binary file from a zip file from C# without unzipping it After read the bin file from the zip file, I read it and make some changes to the data (id1, id2, value1) and then write to a new…
user3448011
  • 1,469
  • 1
  • 17
  • 39
0
votes
1 answer

DotNetZIp blocking unity

I'm using Ionic.Zip.dll to extract a zip file from unity. It works well with zip.ExtractAll(zipPath, ExtractExistingFileAction.OverwriteSilently); But while the archive is extracted the UI hangs (button effects, etc...). So I tried to use this…
FLX
  • 2,626
  • 4
  • 26
  • 57
0
votes
0 answers

Invalid zip. How can I send a zip file as stream to the client?

My goal is to create a zip file, add a text file to it, save it as stream and send it over to the client where it can download it. But when I try to download it, I get an invalid zip file but it has at least more and less the correct size. My guess…
SuffPanda
  • 348
  • 2
  • 17
0
votes
1 answer

Exception thrown: 'System.IO.DirectoryNotFoundException' and System.IO.PathTooLongException

Hello I am trying to extract a zip like Unpack a zip using ZipInputStream (eg for Unseekable input streams). With the help of SharpZipLib. But this always give me an error: Error: Exception thrown: 'System.IO.DirectoryNotFoundException' in…
djkpA
  • 1,224
  • 2
  • 27
  • 57
0
votes
1 answer

Unzip splitted zip file c# (load parts from CD)

I'm trying to unzip a zip file which is splitted to 5 parts. Problem is each part is in a different CD and i need to be able to change disks while unzipping. I have used Ionic.Zip to do that with no luck! foreach (var entry in zip.Entries) { …
Milad Hosseinpanahi
  • 1,495
  • 12
  • 20
0
votes
1 answer

Programmatically merging zip segments made by DotNetZip

I have a problem with merging zip segments which I made using DotNetZip library. I'm zipping big file, which produces files like: abc.zip, abc.z01 and abc.z02. using (ZipFile zip = new ZipFile()) { zip.AddDirectory(fullDir); …
Paweł Reszka
  • 1,557
  • 4
  • 20
  • 41
0
votes
0 answers

Open inner zip file without extracting the inner zip entry

We are using DotNetZipLib for handling zip files. I have a zip file which contains another zip file which contains a lot of (large) files. outerZipFile.zip -> foo.ext -> innerZipFile -> file 1 -> file 2 -> bar.ext I want to…
DerApe
  • 3,097
  • 2
  • 35
  • 55
0
votes
1 answer

.pkpass create fail because of manifest pass.json string format?

This is a very strange question. I using C# to create a pass.json and save it to memoryStream, it work normally. After that I create the manifest.json SHA1 data which including that pass.json, the string of manifest.json like this and it is totally…
Yuk_dev
  • 318
  • 1
  • 6
  • 16
0
votes
1 answer

Using MemoryStream and DotNetZip to zip a json file

I have a JSON file created, and I am going to zip it using DotNetZip. Using with StreamWriter to zip it is working, if I try to use MemoryStream it will not working. StreamWriter : sw = new StreamWriter(assetsFolder +…
Yuk_dev
  • 318
  • 1
  • 6
  • 16
0
votes
2 answers

How to handle errors when using ASP.NET to create a zipfile for download?

I'm working on a functionality in my asp.net web site that enables the user to download some files as a zip file. I'm using the DotNetZip library to generate the zip file. My code looks like this: protected void OkbtnZipExport_OnClickEvent(object…
OKB
  • 715
  • 3
  • 14
  • 30
0
votes
0 answers

zip not extracting created using DotnetZip (Ionic.zip)(1.10.1)

I am using DotNetZip.dll(1.10.1) for creating zip files(media files), Files get zipped but when I try to extract it using WinRaR or with windows extract folder option, I am getting "the archive is unknown format or damaged" List fileNames =…
Ketan
  • 43
  • 1
  • 6
0
votes
1 answer

how can i check if a compressed file(of all formats- zip/rar/tar/uue) is password protected, without extracting it in c#?

I am developing a small utility in c#, where I am inserting many compressed files. These files are in different extensions(such as .zip, .rar, .tar, .uue) Now I do not want to extract these files, but I just want to check if these files are password…
Divya
  • 416
  • 5
  • 10
0
votes
1 answer

Add only new files to zip file

i have a question, i have a directory with all kind of files. when a user clicks on a button in my wpf application, all the files will be added to a zip file in another directory. the problem now is it always zips all the data into the zip. What i…
Thomas V
  • 151
  • 14
0
votes
0 answers

dotnetzip - Cannot read that as a ZipFile / Bad signature at position 0x00000000

I want to unzip a rar file with DotNetZip that have just one entry using (var zip = ZipFile.Read(zipFilePath))//Get exception here { foreach (ZipEntry ex in zip) ex.Extract(Path.GetDirectoryName(zipFilePath),…
Mohammadreza
  • 3,139
  • 8
  • 35
  • 56