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

C# NPOI library and invalid zip compression

I'm using the NPOI library to read and write XLSX spreadsheets in a C# application. This library seems to work, I could open, write and re-open an Excel file. I found a problem when I tried to open a NPOI file with MS Excel, its say that the file…
Tobia
  • 9,165
  • 28
  • 114
  • 219
3
votes
2 answers

Compress large file using SharpZipLib causing Out Of Memory Exception

I have a 453MB XML file which I'm trying to compress to a ZIP using SharpZipLib. Below is the code I'm using to create the zip, but it's causing an OutOfMemoryException. This code successfully compresses a file of 428MB. Any idea why the exception…
CathalMF
  • 9,705
  • 6
  • 70
  • 106
3
votes
1 answer

When using SharpZipLib- Unable to extract tar.gz files from MemoryStream

I need to do so since I'm running from azure Webjob. here is my code: public static void ExtractTGZ(Stream inStream) { using (Stream gzipStream = new GZipInputStream(inStream)) { using (var tarIn = new TarInputStream(gzipStream)) …
marnun
  • 808
  • 8
  • 23
3
votes
2 answers

SharpZipLib's FastZip doesn't unzip directories on Mac

I'm using the following code on Mac using Mono to unzip a zip file. The zip file contains entries under directories (for example foo/bar.txt). However, in the unzipped directory, instead of creating a directory foo with a file bar.txt, FastZip…
sohum
  • 3,207
  • 2
  • 39
  • 63
2
votes
1 answer

C# networkstream compression - Sharpziplib, DotNetZip, gzipstream all give errors on my stream

I have a pair of C# client-server programs that communicate using a networkstream. Everything works fine as it is without compression. Now I'd like to get the bandwidth-usage down, so I want to use a compressing wrapperstream around my…
Pygmy
  • 1,268
  • 17
  • 33
2
votes
2 answers

SharpZipLib cannot use StreamWriter to write text to newly created csv file

I do not seem to be able to write text via StreamWriter to a to be newly created zip file (not gzip). I use SharpZipLib and do not quite comprehend how to get it to work. DJ Kraze helped me with streaming content from a zipped text file to…
Matt
  • 7,004
  • 11
  • 71
  • 117
2
votes
0 answers

How to zip files with japanese names in csharp?

I am using "ICSharpCode.SharpZipLib.Zip" namespace to zip the files. I want to zip some files with japanese names. When i zip using ZipOutputStream i am getting junk filenames. Can anyone help on this?
2
votes
0 answers

SharpZipLib : How Compress a single file to a single zip file with FastZip

I found this method for compressing a single file to a single zip file using SharpZipLib. private static void CompressFile(string inputPath, string outputPath) { FileInfo outFileInfo = new FileInfo(outputPath); FileInfo inFileInfo = new…
SilverLight
  • 19,668
  • 65
  • 192
  • 300
2
votes
1 answer

SharpZipLib - adding folders/directories to a zip archive

From examples, I've got a pretty good grasp over how to extract a zip file. In nearly every example, the method of identifying when a ZipEntry is a directory is as follows string directoryName = Path.GetDirectoryName(theEntry.Name); string fileName…
MoSlo
  • 2,780
  • 4
  • 33
  • 37
2
votes
1 answer

How can I extract a multi-volume zip file using SharpZipLib in C#?

I have a single file, Setup1.cab, which is split up into Setup1.zip.001 and Setup1.zip.002 that I used 7zip to archive. Once those volumes reach their destination, I'd like to be able to use C# to extract that file from both archives into the same…
2
votes
1 answer

sharpziplib compressed files to be uncompressed externally

I have a scenario where by I want to zip an email attachment using SharpZipLib. Then the end user will open the attachment and will unzip the attached file. Will the file originally zipped file using SharpZipLib be easily unzipped by other programs…
DotNetInfo
  • 3,344
  • 6
  • 33
  • 39
2
votes
1 answer

C# SharpZipLib for .NET Core

We have version 0.86 of ICSharpCode.SharpZipLib.dll and it is not .NET Core compatible. There appears to be two main (and several more) "latest" version of it. SharpZipLib and SharpZipLib.NETStandard, both by ICSharpCode. Which is the correct one to…
David Thielen
  • 28,723
  • 34
  • 119
  • 193
2
votes
1 answer

Extract tgz file in memory and access files in C#

I have a service that downloads a *.tgz file from a remote endpoint. I use SharpZipLib to extract and write the content of that compressed archive to disk. But now I want to prevent writing the files to disk (because that process doesn't have write…
binaryguy
  • 1,167
  • 3
  • 12
  • 29
2
votes
1 answer

Extracting AES encrypted zip to MemoryStream

I am developing a process to compress and encrypt a byte array in my desktop application and send it via a WebMethod to my web application, then uncompress/unencrypt it back to a byte array. I am currently attempting to do this with SharpZipLib. The…
Michael Jordan
  • 382
  • 2
  • 13
2
votes
2 answers

ICSharpCode.SharpZipLib.Zip crc32

I am using ICSharpCode.SharpZipLib.Zip to compress the files and folders and pass it as memorystream using response.Binary write. Here is my code: MemoryStream df= new MemoryStream(); ZipOutputStream s = new…
Ramesh.kbvr
  • 763
  • 6
  • 15
  • 31