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
0
votes
1 answer

How to get the size of a compressed file without actually compressing it [SharpZipLib]

In SharpZipLib we use ZipEntry like this: var fi = new FileInfo(file); var ze = new Sharp.Zip.ZipEntry(fi.Name); ze.DateTime = fi.LastAccessTime; ze.Size = fi.Length; …
Simple Fellow
  • 4,315
  • 2
  • 31
  • 44
0
votes
1 answer

Compute hash or compare contents of gzip files in c#

I have the problem of needing to compare files in .tar.gz files to ensure none of the files within the gzip are duplicates. I am currently using ICSharpCode.SharpZipLib, which makes it easy to check for duplicates in Zip files since a ZipEntry has a…
ilyketurdles
  • 113
  • 1
  • 11
0
votes
3 answers

Stream compression for network traffic

I am writing an xmpp library and I am trying to write a stream to support the zlib compressed data. I have two different versions one based on zlib.net and the other using SharpZipLib. The zlib.net version doesn't recognize the compression and the…
Coder2000
  • 281
  • 3
  • 12
0
votes
1 answer

Converting images into Streams for on the fly processing

So im using SharpZipLib to recursively browse through my documents and pack up any JPEG image it finds, like this : foreach (string filename in filenames) { string[] file_split = filename.Split('.'); if (file_split[file_split.Count() -…
amartin94
  • 505
  • 3
  • 19
  • 35
0
votes
1 answer

ZipEntry() and converting persian filenames

In my vb.net project I'm trying to add a file with a Persian name to a zip file and I do this with the code bellow: Dim myentry As New ZipEntry(dr.Item("MyFile").ToString()) zipOut.PutNextEntry(myentry) however when I open the zip file I see the…
Sara Nikta Yousefi
  • 1,467
  • 5
  • 21
  • 35
0
votes
1 answer

C# How to get file/ copy file from a bzip2 (.bz2) file without extracting the file

I have a .bz2 compressed file, and i want to copy the inside file to another location, without decompressing it. I use .net 4.5 with C#. i tried like this, but this is for zip files (.zip): using (var zip = ZipFile.Read(_targetPathComplete + "\\" +…
Tommek
  • 11
  • 4
0
votes
1 answer

Install SharpZipLib to extract targz file

I download Sharpziplib, but i'm unable to install it for C#. I didn't find the DLL. I'm lost with this Library and visualStudio, the sharpziplib contains just batchfile and source. Anyone can help me to install it ?
Neyoh
  • 623
  • 1
  • 11
  • 33
0
votes
1 answer

ICSharpCode zipfile creation error

The following code works on my machine but not in server: using (ZipFile zipFile = ZipFile.Create(outPath)) { if (!includeFolders) { zipFile.NameTransform = new…
Orkun Balkancı
  • 868
  • 1
  • 8
  • 19
0
votes
1 answer

Creating a Zip in memory with SharpZipLib resulting in a corrupt archive

I am using ICSharpCode.SharpZipLib v 0.86.0.518. I have a a stream whose contents I would like to add as a file to a Zip, which must also be created in memory (as opposed to on on disk). The resulting Zip opens for browsing, but when attempting to…
GoetzOnline
  • 417
  • 8
  • 22
0
votes
1 answer

How to modify file attribute in zip file?

Using SharpZipLib, I'm adding files to a existing zip file: using (ZipFile zf = new ZipFile(zipFile)) { zf.BeginUpdate(); foreach (FileInfo fileInfo in fileInfos) { string name =…
joe
  • 8,344
  • 9
  • 54
  • 80
0
votes
1 answer

Port DeflaterInputStream functionality to .net

I am trying to port the following java code to .net: private final byte[] zipLicense(byte lic[]) { byte buf[]; ByteArrayInputStream bis; DeflaterInputStream dis; ByteArrayOutputStream bos; buf = new byte[64]; bis = new…
Maxim V. Pavlov
  • 10,303
  • 17
  • 74
  • 174
0
votes
1 answer

Unzipping XML Files using SharpZipLib adds extra lines to the end (only sometimes)

This is my first attempt at a post, so I'm sorry if I leave out some important details. The company I work for has a program that downloads a zipped file to a computer, and then unzips it into the folder the zip file is in. There are several…
AaronTheRabbit
  • 185
  • 1
  • 8
0
votes
1 answer

Zip several files with SharpZipLib and place inside a string

I have always used SharpZipLib to create zip files in my ASP.NET applications and I find it a very good library. However in the web applications I always used as stream for the zip file the OutPutStream of the http response (Response.OutputStream)…
CiccioMiami
  • 8,028
  • 32
  • 90
  • 151
0
votes
1 answer

add file without full path in zipfolder using SharpZibLib in c#

File can add with full path easily like : z.Add(fpaths); But i wants to add only file not full path use code below but a error : z.Add(fpaths, filenamed); error is! some invalid arguments Please have a look my code and let me know how can i…
0
votes
0 answers

Validate base64 zip xml file by xsd

I need validate base64 zip xml file. Zipped by SharpZipLib.Zip. I create test code for validation, but when run reader.Read() method I have error - System.Xml.XmlException, '.', hexadecimal value 0x00, is an invalid character. Line 1, position 1. …
zrabzdn
  • 995
  • 2
  • 14
  • 33