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

"'iso-8859-1' is not a supported encoding name" exception while Decompress compressed string in Silverlight 5 using DotNetZip (Ionic.Zlib)

I have WCF Service, consumed by Silverlight client. In the service I create a string (which is representing a .csv file) and I compress it. When I try to decompress it on the client I get the following exception: System.ArgumentException:…
Mladen Nikolov
  • 191
  • 1
  • 7
0
votes
1 answer

How to Zip up a ZipFile using DotNetZip?

How (or can) I zip one ZipFile up within another ZipFile? Saving the nested ZipFile to a memory stream that is then written to the other ZipFile seems like the best way to do this, however when I use the code below the nested ZipFile (once I…
Adrian773
  • 473
  • 11
  • 22
0
votes
0 answers

DotNetZip uncompressed exe files not opening

I'v been using the DotNetZip library for uncompressing some files from a ZIP file, compressed using the same library. That ZIP file contains exe files, but once decompressed, some of the exe file decompressed is not opening anymore. That problem is…
0
votes
1 answer

DotNetZip Extract Folder & Contents based on folder comment

I have some code that adds different directories to a zip file. Its important that I know each folder based on its comment, during the extraction process. Here is the zip sample code: foreach (string folder in BackupDIRS) { …
FrostyFire
  • 3,212
  • 3
  • 29
  • 53
0
votes
1 answer

DotNetZip download works in one site, not another

EDIT - RESOLVED: the difference was that in the "main" case the download was initiated via a callback cycle, and in the "test" case it was initiated through a server side button click function. My guess is that the download request and the…
wayfarer
  • 780
  • 2
  • 15
  • 33
0
votes
1 answer

how to make a normal zip file for users in a web application using C#?

I have the following code to create a downloadable zip archive that works fine: ZipFile zip = new ZipFile(); zip.AlternateEncoding = Encoding.UTF8; zip.AlternateEncodingUsage = ZipOption.Always; zip.AddFiles(filePaths, false, "."); string zipName =…
0
votes
2 answers

How to check if file is password protected & password passed by user is correct or not using dotnetzip in c#

In My application I am using DotNetZip to Zip & UnZip files. Before Extracting files I want to know if password provided is correct or not. Right now I am doing it like this. foreach (var sourceFile in sourceFileNames) { ZipFile file =…
vaibhav shah
  • 4,939
  • 19
  • 58
  • 96
0
votes
2 answers

How to pass folder hierarchy when creating zip file from memory stream using DotNetZip library

Requirement: 1) creating split zips file in multiple segments(say size - 1 GB/500 MB), so that they can be downloaded through browser. The total zip volume of all the segments could exceed 10 GB 2) the zip content could be multiple files or a folder…
Mou
  • 15,673
  • 43
  • 156
  • 275
0
votes
1 answer

DotNetZip WinZipAes256 Using Random Salt?

Forgive me if the answer to this is very obvious. I need to know if the AES 256 Encryption in DotNetZip (Ionic.Zip.dll) generates a random salt? e.g. Does EncryptionAlgorithm.WinZipAes256 make use of the internal class WinZipAesCrypto. And…
fourbeatcoder
  • 1,159
  • 3
  • 13
  • 21
0
votes
0 answers

zip file in attachement in not password protected & file inside it is not creted in c#

In my application I have byte[] which I am converting to MemoryStream using bellow code. stream.Write(file, 0, file.Length); stream.Position = 0; I am adding this file as ".csv" to zip file attaching that zip file to email. Attachment…
vaibhav shah
  • 4,939
  • 19
  • 58
  • 96
0
votes
1 answer

zip file comming empty in attachement in email sent using c#

I am creating one zip file and attaching it to email using c# in my project I am using DotNetZip for it. Bellow is code of it Attachment attachment; MemoryStream memoryStreamOfFile = new MemoryStream(); using (ZipFile zip = new ZipFile()) { …
vaibhav shah
  • 4,939
  • 19
  • 58
  • 96
0
votes
0 answers

C# does not accept path within DotNetZip compression

I am struggling with C#, Ionic.Zip and the path declaration. The error message is: The path format is not supported. The path looks right, so no idea what's happening here... This is my code: string datetime =…
udgru
  • 1,277
  • 5
  • 14
  • 26
0
votes
1 answer

Use MemoryMappedFile to increase Brute Force on zip file with dotnetzip C#

I want to increase the number of attempts to open ZIP file and my biggest delay is in IO. I thought to use MemoryMappedFile and I was able to improve performance by 20% only. My CPU usage is only 20% because I got stuck in the IO. The first time I…
Dany Maor
  • 2,391
  • 2
  • 18
  • 26
0
votes
2 answers

Upload multiple files & create zip

I managed to upload two kinds of files successfully & store the respective filepaths on the database. Now,I'd also like to create a zip with both files attached to it. I referenced the codes to this particular webpage regarding zip files & file…
Enovyne
  • 195
  • 1
  • 7
  • 20
0
votes
0 answers

DotNetZip - Extracting files that contain non-ascii characters

I'm trying to extract a zip archive that contains files which contain Japanese characters. When I view the contents of them after extracting, the Japanese characters appear as gibberish. This also happens with Winrar/Winzip which is why I was…
Sakuya
  • 660
  • 5
  • 23