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

PushStreamContent and ionic.zip

My webapi method for zipping on the fly use this code var result = new HttpResponseMessage(HttpStatusCode.OK) { Content = new PushStreamContent((stream, content, arg3) => { using (var…
takayoshi
  • 2,789
  • 5
  • 36
  • 56
1
vote
0 answers

no API available to extract or create a archive with password in windows 8.1

Unfortunately in Windows store 8.1 there is no API available to extract or create a archive with password ,at least this what i find out after a lot of recherche on the web, And because this is very important for us to find out something, we…
Kais Zwawi
  • 301
  • 1
  • 3
  • 5
1
vote
1 answer

Nesting Zip Files and Folders in Memory using DotNetZip Library

We have a page that users can download media and we construct a folder structure similar to the following and zip it up and send it back to the user in the response. ZippedFolder.zip - Folder A - File 1 - File 2 - Folder B …
TheJediCowboy
  • 8,924
  • 28
  • 136
  • 208
1
vote
1 answer

DotNetZip System.UnauthorizedAccessException: Access to the path is denied

I know here is some questions about this error in DotNetZip, I've tried all solutions and failed. I'm developing code on my Win8.1 notebook and have no problems, problems begin after deploy to the remote Win2008R2 server... Here is the problem…
insane
  • 45
  • 2
  • 8
1
vote
1 answer

DotNetZip Library and C# BackgroundWorker to report progress

Using DotNetZip library I'm having difficulty trying to get this implemented with the BackgroundWorker On the DotNetZip Documentation it shows how to Unzip an archive but ot how to Zip and report progress. My attempt public void DoZIP() { …
IEnumerable
  • 3,610
  • 14
  • 49
  • 78
1
vote
1 answer

I want zip file without any directories in zip file.How can I do in c#

My problem is that I want zip my file into zip formatted file. I used DotNetZib library works fine but there is a little problem in there. I read file from C:\Users\Hüseyin\Desktop\AA for instance. But it creates full path which read from path given…
husonos
  • 241
  • 3
  • 14
1
vote
1 answer

DotNetZip why is the last line always truncated

every zip file has a truncated last row. I output the row tot he console and it's not truncated, why would the last line of the compressed file be truncated? using (SqlConnection conn = new…
Chris Hayes
  • 3,876
  • 7
  • 42
  • 72
1
vote
0 answers

ZipOutputStream generates corrupted zip file when zipenty is numerous

I have the code below to simulate an action i am trying to perform using SharpZipLib. The generated zip file runs well when the limit of 'i' is low. But as 'i' tends towards a high value e.g 100, the generated zip file is corrupted. When I repair…
Remade
  • 388
  • 5
  • 13
1
vote
1 answer

Cannot read that as a zip file using DotNetZip 1.9

I am working on an application that will download a .zip file from my server and extract it when the download is complete using DotNetZip 1.9 The application is downloading the zip file properly, but when it gets to the section to read the .zip file…
Meta
  • 1,830
  • 6
  • 24
  • 28
1
vote
1 answer

Compressing a folder on a network path using DotNetZip

I am not sure if its a gap in my understanding. I have to zip a folder which sits on a server in the same network. Suppose I have a folder WebSite on the D drive of ABC machine on XYZ domain (same network as my machine). I use the following code to…
Niranjan
  • 813
  • 2
  • 12
  • 33
1
vote
2 answers

How to see the uncompressed size before unpacking

I am using DotNetZip to extract zip files that come from an extenal (not trustworthy) source. My problem is that the zip file itself can be a couple of kilobytes, but the unzipped content can become petabytes. How to see the uncompressed size before…
Kees
  • 1,408
  • 1
  • 15
  • 27
1
vote
1 answer

Generate XML in memory and write to DotNetZip

I try to do the following: var mem = new MemoryStream(); var xmlWriter = new XmlTextWriter(mem, System.Text.Encoding.UTF8); xmlWriter.Formatting = Formatting.Indented; var xmlSerializer = new…
Enrico
  • 1,937
  • 3
  • 27
  • 40
1
vote
1 answer

Ignore file if it is corrupted

I am using Ionic zip in my WCF service to unzip files uploaded by a 'client'.The files are zipped using Ionic zip.However,there have been instances where the zipped files were 'corrupted'.Since my code scans the entire folder to look for zipped…
user1550951
  • 369
  • 2
  • 9
  • 26
1
vote
1 answer

Reduce file size with DotNetZip

I want to backup my database using SMO and zip a backup file then upload it to my server. here is my code // Backup var conn = new SqlConnection(sqlConnectionString); var server = new Server(new…
Dumi
  • 1,414
  • 4
  • 21
  • 41
1
vote
3 answers

Zip file not downloading after zip was correctly filled but contentlength is empty

On my page I currently have the following: a webgrid with some invoices, for every invoice I have a checkbox, for every invoice I have a pdf-Icon to view the pdf in the browser or to download the pdf. What I'm trying to accomplish is that the user…
thomvlau
  • 602
  • 3
  • 9
  • 24