ZIP file created with SharpZipLib cannot be opened on Mac OS X

前端 未结 10 1616
有刺的猬
有刺的猬 2021-02-04 08:31

Argh, today is the day of stupid problems and me being an idiot.

I have an application which creates a zip file containing some JPEGs from a certain directory. I use th

10条回答
  •  佛祖请我去吃肉
    2021-02-04 09:12

    I had a similar problem but on Windows 7. I updated to the as of this writing latest version of ICSharpZipLib 0.86.0.518. From then on I could no longer decompress any ZIP archives created with the code that was working so far.

    There error messages were different depending on the tool I tried to extract with:

    • Unknown compression method.
    • Compressed size in local header does not match that of central directory header in new zip file.

    What did the trick was to remove the CRC calculation as mentioned here: http://community.sharpdevelop.net/forums/t/8630.aspx

    So I removed the line that is:

    entry.Crc = crc.Value
    

    And from then on I could again unzip the ZIP archives with any third party tool. I hope this helps someone.

提交回复
热议问题