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

"Invalid folder" error when compressing files with SharpZipLib

I have this function that I'm using to compress a list of files from the user's session, and then streaming it to the user's browser for download: public static void DownloadAllPhotos() { HttpContext.Current.Response.AddHeader( …
Steven
  • 18,761
  • 70
  • 194
  • 296
2
votes
2 answers

Most Space-Efficient Way to Store a Byte Array in a Database Table - ASP.NET

Right now we have a database table (SQL Server 2008 R2) that stores an uploaded file (PDF, DOC, TXT, etc.) in an image type column. A user uploads this file from an ASP.NET application. My project is to get a handle on the size at which this table…
Brandi
  • 1,549
  • 4
  • 24
  • 32
2
votes
2 answers

How to decompress .bz2 file in C#?

I am developing wpf application. I am using sharpziplib to compress and decompress files. I am easily decompress the .zip files using following code public static void UnZip(string SrcFile, string DstFile, string safeFileName, int bufferSize) …
Shailesh Jaiswal
  • 3,606
  • 13
  • 73
  • 124
2
votes
0 answers

How to set inflaterInputStream.Position?

I'm trying to set inflater.Position by calling the code below: Stream data = Compress(buffer); // data: length=12, position=12 //inflater: length=0, position=12 InflaterInputStream inflater = new InflaterInputStream(data); …
user1486691
  • 267
  • 5
  • 18
2
votes
1 answer

SharpZipLib ~ How to extract specific files from a zip

Ok, I have a list of files (SourceFile objects which just contain the filename only) then I want to pull those specific files out of a zip and dump them into a temp directory so I can distribute them later. I came up with this, but I am unsure on…
KevinDeus
  • 11,988
  • 20
  • 65
  • 97
2
votes
1 answer

Using ICSharpCode.SharpZipLib.Zip Subfolder in zip when its not supposed to be

I am using the library ICSharpCode.SharpZipLib.Zip; My code is follows: The path is root. \\ALAWP\\THIS\\ACORD\\ I'm zipping them to the ZIPDirectory However when it's done the file is not named acord_combined.txt, instead it's called…
tim.newport
  • 97
  • 3
  • 12
1
vote
2 answers

How to decompress deflate stream (not gzip) using SharpZipLib?

I am working on an app on Windows Phone and trying to get data from a web server by HTTP GET method, and the content-encoding field in the response indicates that the data was compressed by deflate algorithm. I found the useful library SharpZipLib,…
cotaku39
  • 50
  • 6
1
vote
5 answers

SharpZipLib to compress a string

I need to compress a string to reduce the size of a web service response. I see the unit tests in the SharpZipLib samples, but not an example of exactly what I need. In the following code, the constructor for ZipOutputStream returns the exception:…
Roger
  • 2,063
  • 4
  • 32
  • 65
1
vote
1 answer

How to remove folder path within zip file.I want only txt files in zip file

I am generating a zip file from the folder D:\Nagaraj\Dotnet\Zipfile\Zipfile\Filebuild\Hi. There are 2 txt files within the folder. But problem is that within the zip file there is the path D:\Nagaraj\Dotnet\Zipfile\Zipfile\Filebuild\Hi and within…
user1225988
  • 41
  • 2
  • 6
1
vote
2 answers

ICSharpZipLib - unziping file issue

I have an application in ASP.NET where user can upload ZIP file. I'm trying to extract file using ICSharpZipLib (I also tried DotNetZip, but had same issue). This zip file contains single xml document (9KB before compress). When I open this file…
TrN
  • 1,230
  • 2
  • 17
  • 32
1
vote
1 answer

SharpZipLib - what is the status on this product?

I went to download SharpZipLib assemblies but it looks like its not on SourceForge. Is this a problem with their site or is this project no longer available? Is anyone still working on this project?
dev.e.loper
  • 35,446
  • 76
  • 161
  • 247
1
vote
1 answer

Using SharpZipLib to update a zip - something bad if the entry name includes folder

This is my code to update an existing zip, the callers pass in the ZipFile and have a finally block to close the zipfile. private static void AddFiles(ZipFile zipFile, string path, string filesEntryLocation, string pattern = @"*") { …
user206830
  • 189
  • 7
1
vote
3 answers

When does it become worthwhile to spend the execution time to zip files?

We are using the #ziplib (found here) in an application that synchronizes files from a server for an occasionally connected client application. My question is, with this algorithm, when does it become worthwhile to spend the execution time to do…
Michael Kingsmill
  • 1,815
  • 3
  • 22
  • 31
1
vote
1 answer

TarArchive Hangs When Trying to Extract Contents

I'm trying to create a tar archive, then extract all the contents to a file using SharpZipLib. I am able to create the tar archive, but the program hangs when trying to extract it. I'm wondering if anyone else can reproduce this problem and see why…
Raiden Hi
  • 61
  • 5
1
vote
0 answers

SharpZipLib does not unzip password protected zip-file

I use SharpZipLib to unzip files. For this, I use this code: using (var fsInput = File.OpenRead(zipFile)) using (var zf = new ZipFile(fsInput)) { zf.Password = password; foreach (ZipEntry zipEntry in zf) { …
BennoDual
  • 5,865
  • 15
  • 67
  • 153