C# with SharpZipLib - Compatibility of SharpZipLib with Winzip and XP?
Asked Answered
G

1

7

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 library to compress in a Winzip/XP compatible format?

Grison answered 14/9, 2009 at 16:8 Comment(0)
C
14

Set this in your ZipOutputStream:

 UseZip64 = ICSharpCode.SharpZipLib.Zip.UseZip64.Off

Zip64 is not compatible with the Windows XP compressed folders utility or with WinZip.

Edit: apparently the API has changed since the version I'm using, the property is now an enum rather than a Boolean value.

Catalpa answered 14/9, 2009 at 16:11 Comment(3)
I tried s.UseZip64 = false but VS2008 complains Cannot implicitly convert type 'bool' to 'ICSharpCode.SharpZipLib.Zip.UseZip64'?Grison
Need to use s.UseZip64 = UseZip64.OffGrison
Found this answer and while it helped, I also had to remove the CRC from the entries as well.Windy

© 2022 - 2024 — McMap. All rights reserved.