Questions tagged [sharpziplib]

#ziplib (SharpZipLib) is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform.

The #ziplib (SharpZipLib) is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform. It is implemented as an assembly (installable in the GAC), and thus can easily be incorporated into other projects (in any .NET language). The creator of #ziplib put it this way: "I've ported the zip library over to C# because I needed gzip/zip compression and I didn't want to use libzip.dll or something like this. I want all in pure C#."

Reference: http://www.icsharpcode.net/opensource/sharpziplib/

Installation

SharpZipLib can most easily be installed through its NuGet package.

Install-Package SharpZipLib
272 questions
2
votes
1 answer

Using SharpZipLib How do I set the encryption algorithm?

I am writing a zip file generator which will be consumed by a third party using a specific encryption algorithm I have found the enumeration of algorithms here: ICSharpCode.SharpZipLib.Zip.EncryptionAlgorithm But I don't know how to apply the…
Myster
  • 17,704
  • 13
  • 64
  • 93
2
votes
2 answers

SharpZipLib Problems Due to Zip Files with \ instead of /

I have a load of Legacy zips that have been zipped incorrectly. Files were saved in the zip so they are folder\filename rather than folder/filename. What that means is code like this: using (ZipFile zipFile = new ZipFile(@"zippath.zip")) { for…
Luke Belbina
  • 5,708
  • 12
  • 52
  • 75
2
votes
2 answers

How can I dynamically add files to a zip archive stored in Azure blob storage?

I have a process in Azure that generates a large number of pdf report files and stores them in blob storage. Rather than send links to all these individually, I'm generating a zip file and sending this link to users. This process is all done in a…
DaveA
  • 187
  • 1
  • 13
2
votes
0 answers

SharpZipLib cyrillic filenames in win7

I have archive with cyrillic filenames created at Win10 var path = "D:\\encoding.zip"; using (var tempZip = new ZipOutputStream(System.IO.File.Create(path))) { for (int i = 0; i < 10; i++) { …
takayoshi
  • 2,789
  • 5
  • 36
  • 56
2
votes
1 answer

Delete original file after zipping it

I am looping through a directory and zip the files in it. In the following code, I am adding the original file to a zipOutputStream, and then delete the file. With the code below, I get the following exception: Exception thrown:…
AntsaR
  • 380
  • 1
  • 9
  • 28
2
votes
1 answer

How to compress only files without folders using the SharpZipLib library? (C#)

I use the following code to create a zip file: var files = Directory.GetFiles(targetPath); var zip = ZipFile.Create(targetPath + "/myzip.zip"); zip.BeginUpdate(); foreach (var file in files) zip.Add(file,…
Jean Louis
  • 1,485
  • 8
  • 18
  • 33
2
votes
1 answer

Send a zip file as it is being created

On my website, when a user clicks a certain button, a bunch of files have to be archived in a zip and sent out. The files themselves are generated by a third part and I only have the URLs. I have partly succeeded in that, but I have some…
Ogier
  • 150
  • 9
2
votes
3 answers

Same C# code slower in ASP.Net application versus Winforms App on same machine

We have a function in C# that uses the ICSharpCode SharpZipLib BZip2 decompression method to uncompress some XML we get from a database. We have noticed an issue on two of our webservers (Win 2K and Win 2003 Svr) that this code takes a really long…
2
votes
6 answers

Cannot Delete Zip file Created by SharpZipLib (FastZip)

I'm creating a zip file using the class FastZip from SharpZipLib and once I after I close the program, I cannot delete the file because: "Cannot delete zip.zip: It is being used by another person or program. Close any programs that might be using…
LuRsT
  • 3,973
  • 9
  • 39
  • 51
2
votes
1 answer

What's up with SharpZipLib versions?

Been having trouble lately trying to determine what's the Single Point of Truth about SharpZipLib. What's the real truly latest version? Its github repository doesn't contain any git tag at all. There are 3 nuget repositories: What looks to be the…
knocte
  • 16,941
  • 11
  • 79
  • 125
2
votes
2 answers

sharpziplib - can you add a file without it copying the entire zip first?

Im trying to add a file to an existing .zip file using sharpziplib - problem is, the zip file is 1GB in size. When i try to add 1 small file (400k) sharpziplib creates a copy/temp of the orig zip file before adding the new file - this poses a…
schmoopy
  • 6,419
  • 11
  • 54
  • 89
2
votes
1 answer

SharpZipLib - adding a ZipEntry to a ZipFile throws a ZipException

I'm trying to create ZIP with file from in-memory string and save it. Here is my code so far: var zip = ZipFile.Create(Path.Combine(outputPath, fileName)); zip.BeginUpdate(); var fileStream = new…
Andrzej
  • 848
  • 1
  • 11
  • 26
2
votes
0 answers

Cannot extract tar.gz file which is created using SharpZip library

Functionality : Create .tar.gz file using windows service. Upload it to SFTP server. Download it in Linux machine and extract using Linux command. I have a windows service where I compress file to .tar.gz using SharpZipLib library. Now issue is…
SpiderCode
  • 10,062
  • 2
  • 22
  • 42
2
votes
2 answers

Request admin privileges to edit system files

New to C#, I'm developing a windows form application inside visual studio. The app uses ICSharpCode.SharpZipLib library to update a zip's content. When the zip file is inside a non system partition, say like D:\myzip.zip the files gets updated…
numediaweb
  • 16,362
  • 12
  • 74
  • 110
2
votes
3 answers

Odd Error in SharpZipLib -- Size was x, but I expected y

I'm getting an error when I use the SharpZipLib. I have code that looks like FastZip compressor = new FastZip(); compressor.CreateZip(outputFileName, currentWorkingDirectory, true, ""); Which seems to be correct. However, I get a ZipException…
GWLlosa
  • 23,995
  • 17
  • 79
  • 116