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

The Archive is either in unknown Format or Damaged using Dotnetzip library to zip file

I am using below code to zip the memory stream on the fly dynamically and creating excel file inside that zipfile .....using dotnetzip dll ...... public ActionResult ExportToExcel() { byte[] file; DataTable dt =…
Glory Raj
  • 17,397
  • 27
  • 100
  • 203
0
votes
3 answers

System.IO.FileNotFoundException Reference not found on when run on users computer

I am making a program in C# with Visual Studio Express 2013. I am using Ionic.zip (dotnetzip). When i run it from the .../bin/release directory or from Visual studio, it runs perfectly fine. when the end user has it on their computers, or I run it…
therimmer96
  • 23
  • 1
  • 6
0
votes
1 answer

Create zip file without inclusion of folders.

i have tried below code, and it is creating zip file . but the problem is when i unzip it , i have seen that it is saving my file (csv file) but with all root folder. i just want that when i unzip my zip file, there should be only csv file , not all…
User5590
  • 1,383
  • 6
  • 26
  • 61
0
votes
1 answer

how to remove path dotnetzip c#

my project is framework 4.0 so i use DotNetZip. i have a code to save zip to E: using (ZipFile zip = new ZipFile()) { zip.AddFile(CGlobalVar.CurrentMissionFolder + "\\OutputTxt\\" + satuan.sName + "\\child.txt"); …
Antares
  • 15
  • 2
0
votes
2 answers

asp.net security exception ''System.Security.Permissions.FileIOPermission' using DotNetZip

I've integrated the DotNetZip dll into an ASP.net/VB project. But when I try to open a file for reading, I get a security exception: System.Security.SecurityException: Request for the permission of type…
Stanton
  • 1,334
  • 4
  • 18
  • 32
0
votes
2 answers

Zipping file with DotNetZip

I am trying to zip and encrypt a chosen file from the user. Everything works fine except that I am zipping the whole path, i.e not the file itself. Below is my code, any help on how I can zip and encrypt on the chosen…
user3274252
  • 57
  • 1
  • 6
0
votes
1 answer

Decompress ZLib archive containing directory

I have an archive in the Zlib format. I am trying to decompress it using C#. The archive contains one file and a folder full of more files and folders. So far, I have been able to decompress the single, top-level file. However, the directory hasn't…
sirdank
  • 3,351
  • 3
  • 25
  • 58
0
votes
0 answers

Difference between TWO approaches to create a ZIP file

In my application, I need to convert the file which is dropped by user to a ZIP file, in a temporary folder. I am using DotNetZip for this purpose by writing something like this. zip.AddFile("DroppedFile.xyz"); zip.Save("C:\\Temp\MyZip.zip"); I was…
snippetkid
  • 282
  • 4
  • 16
0
votes
1 answer

How to create separate zip files for all the files with password within a directory using DotNetZip?

I have a source folder in which multiple files are there. I need to create separate zip files with password for all the files within this source folder. I tried it, but not getting the desired result. Please guide me. this is the code which I'm…
user3264676
  • 253
  • 5
  • 8
  • 20
0
votes
1 answer

DirectoryNotFoundException when running from PCs other than Server in C#

I have developed a console application which zips up files within a directory with password to a destination folder. I am zipping files within a directory to a destination folder with password. This is the code. In my local PC its working fine. I…
Brijraj
  • 177
  • 2
  • 3
  • 13
0
votes
1 answer

BadRequest unexpected token ILLEGAL when downloading ZIP file

I am working on an asp.net application using Ext.Net for my UI and Ajax calls (DirectMethods). I am trying to download a zip file on the server using DotNetZip. There are two parts to the download process: Part 1: First invoke method ExportXML to…
Vaibhav Pingle
  • 575
  • 1
  • 9
  • 27
0
votes
0 answers

stream to zip using DotNetZip

I have a Stream that i want to read and then zip it, This stream is generated by HttpRequestMessage in web api as posting a zip file through restclient and code as below var task = this.Request.Content.ReadAsStreamAsync(); task.Wait();…
GowthamanSS
  • 1,434
  • 4
  • 33
  • 58
0
votes
0 answers

Rolling archive file by date Using c# dotnetzip

I am trying to create an archive file and keep adding files to it until it is the next day. So like a rolling archive file per each day. I cant seem to figure this out, I can seem to create archive files for each file coming in, but not one giant…
0
votes
2 answers

Sending gzipped data over a network from C# to Java

I have an application that sends data gathered from a data source on my PC (say, Excel or Access) to a receiving app on an Android tablet. I am in the testing stage of compressing the data before it is sent and then decompressing it after it is…
Fam
  • 580
  • 1
  • 7
  • 29
0
votes
1 answer

DotNetZIp TargetInvocationException on .AddSelectedFiles

i am trying to zip a list of files from a directory based on some criteria, using the selection property. Here is the code using (ZipFile zip = new ZipFile()) { string selection = "ctime > " +…
Panos Antoniou
  • 73
  • 1
  • 12