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

Transform String Folder Path

I'm doing a C# project for school. I need to extract a .zip file but i have a problem. I get the path where the file that is going to be extract is with FolderBrowserDialog and everything is ok, but the FolderBrowserDialog gives me something like…
0
votes
0 answers

DotNetZip ZipFile Entries List incomplete?

I have been using DotNetZip successfully so far, but now I've run into a hiccup. I'm wondering if I'm just missing something and this is expected behavior or if this is actually a bug. I use the following simple code to iterate through all files…
janb
  • 360
  • 5
  • 16
0
votes
1 answer

Error A local variable cannot be declared in this scope

I am trying to unzip a file with DotNetZip but I get a error on the "e" using (ZipFile zip = ZipFile.Read(openFileDialog1.FileName)) { foreach (ZipEntry e in zip) { e.Extract(Environment.CurrentDirectory,…
Orangelight
  • 147
  • 2
  • 3
  • 8
0
votes
1 answer

zip files with same names but different extensions using Ioniz.Zip DLL

I need help in writing a function which zips all files with same name but different extensions in a folder.I am using Ionic.Zip dll to achieve this.I am using .Net compact framework 2.0,VS2005. My code looks like this: public void zipFiles() …
user1550951
  • 369
  • 2
  • 9
  • 26
0
votes
1 answer

Check files in zip using DotNetZip

So I have two functions that need help. Public Function checkZipForFiles(ByVal zipFilepath As String) Try Dim doc As New System.Xml.XmlDocument If My.Computer.FileSystem.FileExists("Backup.xml") Then …
MaylorTaylor
  • 4,671
  • 16
  • 47
  • 76
0
votes
1 answer

How do I extract a SubDirectory using C# DotNetZip?

I have MyFile.zip that has a main directory "MyMainFolder", and several SubDirectories inside of that, one of which I want to extract (MySubFolder)...with all of its subdirs and contents. I am trying to figure out how to 'step-into' the MyMainFolder…
CopalFreak
  • 53
  • 1
  • 2
  • 11
0
votes
1 answer

Logic help for DotNetZip loop logic

I have a logic problem, just need more brains working on this. For Each JobNode In JobNodes Dim Source = JobNode.SelectNodes("Source") For Each item As System.Xml.XmlNode In Source Dim…
MaylorTaylor
  • 4,671
  • 16
  • 47
  • 76
0
votes
2 answers

Write grayscale BMP to ZIP file from Memorystream

I'm trying to test whether writing individual images or a bundle zipped is quicker. My approach is to create a random byte array of values between 0 and 255 (8-bit image) and form a Bitmap from it, writing repeatedly using Bitmap.Save. In this way…
zotty
  • 797
  • 2
  • 9
  • 27
0
votes
0 answers

How to use DotNetZip Library

I unziped the file I donwloaded. how and what library do i access in my asp.net mvc 3 app to be able to unzip a file that contains multiple files? my controller code: public ActionResult Upload(ScormUploadViewModel model) { if…
charlie_cat
  • 1,830
  • 7
  • 44
  • 73
0
votes
1 answer

Grab X Amount Of Files and Zip Using DotNetZip Library

So I've been using the DotNetZip Library for some time now, and it works pretty well, up until yesterday when I maxed out the zipfile size. On any given day, I need to zip PDFs and transfer them to an SFTP site, that only accepts zip files. The…
Muhnamana
  • 1,014
  • 13
  • 34
  • 57
0
votes
1 answer

Save all the folder structure with DotNetZip

I did this simple code with the latest version of the library DotNetZip, for some reason when I add a file I get all the folder structure. For example if I add: C:\one folder\two folders\File.doc Inside the zip file I will have one folder\two…
0
votes
1 answer

DotnetZip problems with silverlight(lightswitch)

so I am having this problem that I can't figure out at the moment. I have already Grabbed the patched Ionic.zip from "http://dotnetzip.codeplex.com/workitem/14049". I tested my code on a non-silverlight project using the ionic.zip for regular c# and…
0
votes
1 answer

c# Reference for DotNetZip

I am using dotnetzip - I am using the following file as a reference - Ionic.Zip.dll I have it currently point to a location from my C: drive. I usually use NuGet so not aware of how where I would put the .dll so that when it is promoted to…
Nate Pet
  • 44,246
  • 124
  • 269
  • 414
0
votes
1 answer

Create ZIP file from Server.Execute calls

I have a .NET website and a page that will return a generated PDF when navigated to (using EssentialObjects PDF library). I would like to have another page that would be able to make multiple calls to Server.Execute in a loop and execute the URL to…
sbonkosky
  • 2,537
  • 1
  • 22
  • 31
0
votes
1 answer

DeflateStream compress/decompress inconsitency

I have the following data from a photoshop file that uses zip-compression (RFC1951): 250, 255, 159, 1, 47, 248, 63, 42, 63, 172, 229, 1, 2, 12, 0, 209, 255, 31, 225 Which decompresses to the following, x16: 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
George R
  • 3,784
  • 3
  • 34
  • 38