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
0 answers

access asp:Gridview in asp:content (dotnetzip)

I have a grid view showing the list of all the images from a folder with a checkboxes to select the images and download the selected ones. But when I click on download. Nothing happens. I believe this problem have something to do with girdview being…
Evik Ghazarian
  • 1,803
  • 1
  • 9
  • 24
0
votes
0 answers

In the DotNetZip lib, why doesn't Inflate use FlushType?

I'm working with DotNetZip, a zipfile class library. I noticed that the Inflate method takes a FlushType parameter "flush", yet this method doesn't use it at all. The only reference to this parameter is commented out. Is there any reason for flush…
Druid
  • 1
  • 2
0
votes
0 answers

Create Archives from empty csv-files which are password protected using DotNetZip

My code is creating archives from csv-files. Some of which are potentially empty. The Problem is, that archives created from empty files are not password protected, although a password is provided. With non empty files it works perfectly well. As…
Martin
  • 1
0
votes
1 answer

How to zip files from folder but keep it separated

I have 1 folder that contains many txt files. I want to zip them but separated. Example: In this folder I have A.txt, B.txt, C.txt. I want to zip all the files but separated so the result will be A.zip, B.zip, C.zip. string outputPath =…
user11548035
0
votes
1 answer

ZLIB.net (.NET) zeros after inflating a byte array (randomly working)

I am confused by the behavior of Deflate algorithm, such as, the first chunk of bytes (size 12~13k) always decompress successfully. But the second decompression never turns out successful.. I am using DotNetZip (DeflateStream) with a simple code,…
Slavi
  • 576
  • 1
  • 3
  • 18
0
votes
2 answers

Decompress ZIP Stream

For some reason I cannot find any examples for doing so with DotNetZip. I receive a Gziped content from my WebAPI. All I want to do is to read that memory stream from the response and unzip the content(text) into a string. My compression working…
omriman12
  • 1,644
  • 7
  • 25
  • 48
0
votes
1 answer

Setting password for zip file using DotNetZip

Using zip As ZipFile = New ZipFile zip.Password = "Test" zip.AddFile("C:\Test.txt", "") zip.Comment = ("This zip file was created at " & DateTime.Now.ToString("G")) zip.Save(path) End…
user10982370
0
votes
0 answers

DotNetZip how to delete a file after extracting

I found out a problem in my project. I'm currently using a DotNetZip library to extract zip - files. Additionally, I need to delete a zip file after extracting it's content. However, I'm unable to do it (both manually and using File.Delete(...)),…
Fedir Katushonok
  • 391
  • 5
  • 13
0
votes
1 answer

Can't set password using DotNetZip

I'm trying to password protect a zip file using DotNetZip. But it doesn't work. It creates the zip just fine, but if i open it using 7zip I can extract the files without a password. Here is the code I'm using. using (ZipFile zip = new…
0
votes
1 answer

dotnetzip creating empty corrupted file

I'm trying to create an HTTP triggered function that will pull down a blob out of Azure storage, zip it, and then reupload the zip to blob storage. Somewhere along the way this is going wrong. It successfully zips and re-uploads but the zip file has…
Abifail
  • 23
  • 4
0
votes
0 answers

How do I fix this CRC32 Error while using DotNetZip?

I am using the DotNetZip Library to generate a Zip File from byte arrays being retrieved from a SQL Server Database. I keep getting CRC32 as 0000000x0 for some of the files due to which the entire archive gets corrupted. I have tried implementing…
reddevil_j
  • 33
  • 11
0
votes
1 answer

Write zip files to MemoryStream

I have a controller action that creates a zip file and sends back to user for download. The problem is that the zip file gets created but it is empty. Somehow it's not writing the image files to the MemoryStream. I wonder what I am missing. If I…
MKF
  • 426
  • 7
  • 24
0
votes
0 answers

"Bad state (invalid distance code)" when running CheckZipPassword() in loop

I am trying to build a small CommandoLine-app that can bruteforce a password for an encrypted Zip. My approach is to generate passwords and then try them using CheckZipPassword(). However I get this error: Unhandled Exception:…
Jonathan Hansen
  • 113
  • 1
  • 7
0
votes
1 answer

Read content of a txt file inside a folder which is inside a Zip file

I am trying to read the content of text files which can or can not be placed inside a folder I am using DotNetZip Library to achieve this The structure is something like this Condition 1 : ZipFile/Folder(any name)/List of TXT Files. Condition 2…
user8655507
0
votes
1 answer

Problem with extracting files with DotNetZip. It doesn't extract files. what's the problem?

private void ZipExtract(string zipfilename) { var path = Server.MapPath(@"~/Files"); ZipFile zip = ZipFile.Read(zipfilename); zip.ExtractSelectedEntries("name=*.jpg,*.jpeg,*.png,*.gif,*.bmp", " ",…
federer_15
  • 21
  • 1
  • 3