Rebex zipped file can't be opened by using Windows XP built-in zip tool

0 votes
asked Feb 3, 2011 by Vincent (120 points)
edited Feb 15, 2011

Here are two of my testing method, the first one which push the stream into zip is not working the second one which add disk file into zip it's working. I'd like to know how to make the first one working?

        void TestRebexZip()
    {
        byte[] data = File.ReadAllBytes("../../TextFile1.txt");

        using (ZipArchive zip = new ZipArchive("rebex.zip"))
        {
            MemoryStream ms = new MemoryStream(data);
            //zip.FilePath = "./";
            //textBox1.Text = zip.FilePath;
            zip.AddFile(ms,"t2.eml");

            zip.Save();
        }
    }

    void TestRebexZipLoadFile()
    {
        byte[] data = File.ReadAllBytes("../../TextFile1.txt");

        using (ZipArchive zip = new ZipArchive("rebex_2.zip"))
        {
            //textBox1.Text += "\r\n" + zip.FilePath;
            zip.AddFile("../../TextFile1.txt");

            zip.Save();
        }
    }
Applies to: Rebex ZIP

1 Answer

+1 vote
answered Feb 3, 2011 by Lukas Matyska (60,650 points)
edited Feb 15, 2011

Unfortunately, when the input comes from a stream, ZipArchive uses the Zip64 feature, but it seems Win XP cannot handle Zip64 archives.

In the current build this behaviour cannot be changed. In upcoming release, which is going to be published next week, default behaviour will be not to use Zip64 feature if possible. Also new option will be added to handle usage of the Zip64 feature.

If you would like to try a beta version, please let us know.

EDIT:

The default behaviour was changed in Build 4060.

Zip64 is no longer used for data added from Stream by default. ZipArchive.Options.Zip64Mode property added to make the behavior configurable.

commented Feb 3, 2011 by Vincent (120 points)
I see a new version on the download page, just want to confirm whether it is the right one Build 4050 released 2011-02-02
commented Feb 3, 2011 by Vincent (120 points)
We had a lot of customers who use xp and built-in zip tools, they complain about this issue, when we use SharpLibzip. That's why we purchase this component.
commented Feb 4, 2011 by Lukas Matyska (60,650 points)
The Build 4050 is without the Zip64 behaviour modification. It will be added in new build which will be released next week. We let you know on your email.
commented Feb 13, 2011 by Vincent (120 points)
Any update for that?
commented Feb 15, 2011 by Lukas Matyska (60,650 points)
We released new Build 4060 (yesterday evening/today morning). I have just send you an email. If interested see our blog http://blog.rebex.net/news/archive/2011/02/15/build-4060.aspx
...