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

Zip files and attach them to MailMessage without saving a file

I'm working on a little C# ASP.NET web app that pulls 3 files from my server, creates a zip of those files, and sends the zip file to an e-mail recipient. The problem I'm having is finding a way to combine those 3 files without creating a zip file…
KrispyMart
  • 31
  • 1
  • 3
0
votes
1 answer

DotNetZip How to fix 0000000 CRC32 issue?

I'm using DotNetZip to add multiple MemoryStreams to a single archive. So far, my code works when I select 1 or 2 files, but does not work if I add more. I found the difference is the CRC32 are all 00000000 for those bad archive. Is it something…
Steven Zack
  • 4,984
  • 19
  • 57
  • 88
0
votes
1 answer

DotNetZip - Adding Folders

i imagine this is very simple but i can find nothing in the DotNetZip examples or documentation to help me. I need to add a folder to a zip that contains both folders and files, i need to maintain the folders rather than only zipping their files but…
Dan Hall
  • 1,474
  • 2
  • 18
  • 43
0
votes
1 answer

DotNetZip in BackgroundWorker update progressbar and label on a form

I'm creating option to backup data of my app with DotNetZip and to avoid freezing the app I've found that the best way for a this type of action best way is to use BackgroundWorker. So I came with something like this: private void…
Dawid
  • 385
  • 9
  • 19
0
votes
2 answers

Generating a zipOutputstream from a folder having other .zip files in it

I am trying to convert an entire azure blob storage folder and its contents to a zip file .Inside this folder ,I have different types of files eg, .txt,.mp3,.zip files .But once the folder is converted to zip file I noticed that all the .zip file…
Millar
  • 1,095
  • 6
  • 16
  • 34
0
votes
2 answers

DotNetZip | C# Getting the extracted folder, not the .zip file that has just been unzipped?

I currently have this code: foreach (string file in openFileDialog1.FileNames) { String ExtractPath = Path.GetDirectoryName(file); try { using (ZipFile zip = ZipFile.Read(file)) { …
0
votes
1 answer

Compressing a directory on the go using Xceed

I have a directory that contains several files. I want to compress this folder to a zip (using Xceed third party dll library) and push to user through HTTP. At the same time I would like to create a log of all the files inside the folder and append…
A.Salam Alasaadi
  • 167
  • 1
  • 2
  • 11
0
votes
2 answers

Add multiple files to archive

I have no idea why this won't work - starting to drive me crazy! Nobody else seems to have this problem My code looks something like this: Stream stream = new MemoryStream(); try { // output zip using…
CompanyDroneFromSector7G
  • 4,291
  • 13
  • 54
  • 97
0
votes
1 answer

Extract a bytearray variable using C# DotNetZip

I have a C# function that receives a compressed ByteArray as a parameter. I need to EXTRACT this byteArray and send the resulting uncompressed byteArray to another function. I need help extracting zipBytes to unzippedBytes please see below PSEUDO…
0
votes
0 answers

Why does DotNetZip cause OutOfMemory Exception in Images?

I have tried zipping an .PNG image file to a zip file using DotNetZip but after I extract it later on and use the Image.FromFile method it gives me an OutOfMemory Exception. I have tried other images but it gives me the same result. If I override…
0
votes
1 answer

DotNetZip and Vietnamese Characters in Contents

I've been using DotNetZip for a while but just ran into a problem. I have some text (not the filename but the actual text contents) which includes non-Latin characters (specifically Vietnamese). When I use DotNetZip to zip up this content, every…
John
  • 1,124
  • 1
  • 11
  • 27
0
votes
1 answer

Stream is empty from ZipFile

I am trying to unzip a zip-file that contains a single txt-file. But I must be handling the streams wrong or something because the output is an empty string. content = new StreamReader(ms).ReadToEnd(); // content is "" I use the DotNetZip open…
Kasper Hansen
  • 6,307
  • 21
  • 70
  • 106
0
votes
1 answer

Create a self extracting file using VB.NET and DotNetZip or IonicZip Libraries

Well I'm very newbie with these libraries, where can I found information about the thing that I want to do? Thanks :)
Seazoux
  • 621
  • 1
  • 5
  • 28
0
votes
1 answer

How to add a zip file to zip file using C# and DotNetZip

I am using DotNetZip (http://dotnetzip.codeplex.com/) to build Zip files on the fly. I would like to be able to create a ZIP file in code and then add it to another ZIP file in code. Will this work? My code is below. I am trying to use a…
Corey Burnett
  • 7,312
  • 10
  • 56
  • 93
0
votes
1 answer

DotNetZip password error

I am using DotNetZip to archive files inside a zip file, using a password. The password I use has 144 random characters. using (var zip = new ZipFile()) { zip.Password = "144 characters password"; zip.Encryption =…
Catalin
  • 11,503
  • 19
  • 74
  • 147