sharpziplib

SharpZipLib - ZipException "End of extra data" - Why am I getting this exception?

I'm using SharpZipLib version 0.85.5 to unzip files. My code has been working nicely for a couple of months until I found a ZIP file that it doesn't like. ICSharpCode.SharpZipLib.Zip.ZipException: End of extra data at ICSharpCode.SharpZipLib.Zip.ZipExtraData.ReadCheck(Int32 length) in C:\C#\SharpZLib\Zip\ZipExtraData.cs:line 933 ...

SharpLibZip: Add file without path.

I'm using the following code, using the SharpZipLib library, to add files to a .zip file, but each file is being stored with its full path. I need to only store the file, in the 'root' of the .zip file. string[] files = Directory.GetFiles(folderPath); using (ZipFile zipFile = ZipFile.Create(zipFilePath)) { zipFile.BeginUpdate(); ...

Basics of SharpZipLib. What am I missing?

I have the following method in my code: private bool GenerateZipFile(List<FileInfo> filesToArchive, DateTime archiveDate) { try { using (ZipOutputStream zipStream = new ZipOutputStream(File.Create(GetZipFileName(archiveDate)))) { zipStream.SetLevel(9); // maximum compression. byte[] buffer...

Using SharpZipLib to unzip specific files?

I'm trying to use SharpZipLib to pull specified files from a zip archive. All of the examples I've seen always expect that you want to unzip the entire zip, and do something along the lines of: FileStream fileStreamIn = new FileStream (sourcePath, FileMode.Open, FileAccess.Read); ZipInputStream zipInStream = new ZipInput...

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 SharpZipLib version enters an infinite loop. You can find the appropriate code at http:/...

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 the file and try again." The code that is generating the file is simply this: fZip.Create...

SharpZipLib extracted file size

Is there a way to find out what the total size of the unextracted archive would be when extracted. ...

#ZipLib error while decompressing GZip

Hello, I'm getting this error while trying to decompress some GZ files with #ZipLib 0.85.5 Those file are not corrupted, I'm able to decompress it correctly using 7-Zip. ICSharpCode.SharpZipLib.SharpZipBaseException Unexpected EOF Any idea? Thanks ...

Why are executable files not included in 'Extract All' on one machine, but not another?

We're providing a zip file of our application for testing and the same zip file on two separate machines is extracted differently. One will extract all files, the other will extract all but the executables (.exe and .msi specifically). We're going to have to tell our customers something other than 'use WinZip' (or 7zip, or whatever) Wh...

Adding to/Delete from zip file can't find temp files

My program lets users add files to a zip file one upload at a time. The first upload creates a zip file, and subsequent uploads add to the created file. It also displays a list of all the files in the zip file, and lets users delete individual files. I use SharpZipLib and this works perfectly on my local computer, but once I uploaded ...

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? ...

SharpZipLib ~ File Version

How do I get the version attribute of a file? I tried the "Version" prop but it gives me the same number for all files My Code: while (getNextEntry) { ZipEntry entry = inStream.GetNextEntry(); getNextEntry = (entry != null); if (getNextEntry) { string fileType = Path.GetExtension(entry.Name); string vers...

How do I zip on the fly and stream to Response.Output in real time?

I am trying to use the following code: I get a corrupted zip file. Why? The file names seem OK. Perhaps they are not relative names, and that's the problem? private void trySharpZipLib(ArrayList filesToInclude) { // Response header Response.Clear(); Response.ClearHeaders(); Response.Cache.SetCa...

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 how to proceed next.. private List ExtractSelectedFiles() { List zipFilePaths = new...

c# sharpziplib adding file to existing archive

Hi, am trying to add a file to an existing archive using the following code. When run no errors or exceptions are shown but no files are added to the archive either. Any ideas why? using (FileStream fileStream = File.Open(archivePath, FileMode.Open, FileAccess.ReadWrite)) using (ZipOutputStream zipToWrite = new ZipOutput...

C# with SharpZipLib - Compatibility of SharpZipLib with Winzip and XP?

I am using the CSharpZipLib library to automatically zip some files. The problem is that the resulting zip file doesn't work with Winzip (version 8.1) or XP's compressed folders. It does work with 7zip. Winzip gives an error that this file is not in the standard Zip 2.0 format. Is there a parameter that I can change that would get the...

SharpZipLib is only compressing some of the directory's sub-directories

I'm using SharpZipLib to create a zip file of a directory in a .NET 3.5 project, and I'm creating the archive like that : fastZip.CreateZip(Server.MapPath(zipToPath), Server.MapPath(zipFromPath), true, null); And that doesn't set neither files nor folders filters. The problem is that the outcome zip file only has some of the sub-dire...

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 claiming that size was 0, but I expected 54 I have no idea what that means. Anyone have...

How do I add files to an archive using SharpZipLib with no compression?

How do I add files to a Zip archive using SharpZipLib with no compression? Examples on Google seem to be woefully thin. ...

Issue with Zipped Streams from .Net and reading them from Java

I'm trying to zip a stream from .Net that can be read from Java code. So as input I have a byte array, which I want to compress and I'm expecting to have a binary array. I've tested with SharpZipLib and DotNetZip to the compressed byte array, but unfortunately I always get an error when trying to uncompress it using the java.util.zip.De...