DotNetZip.Semverd icon indicating copy to clipboard operation
DotNetZip.Semverd copied to clipboard

Bad signature (0x6F9E597E) at position 0x00AF8F62

Open kamran1331 opened this issue 8 years ago • 4 comments

The error is coming at the moment when i make --> input.GetNextEntry() by Extracting from this ZIP

https://www.dropbox.com/s/ckli5dv3kzmk6gj/sample.zip?dl=0

Can anybody help me?

my code for extracting:

byte[] buffer = new byte[2048];
int n;

using (var raw = File.Open(zipFilePath, FileMode.Open, FileAccess.Read))
{
    using (var input = new ZipInputStream(raw))
    {
        if (!string.IsNullOrEmpty(password))
            input.Password = password;

        ZipEntry entry;

        while ((entry = input.GetNextEntry()) != null)
        {
            if (entry.IsDirectory) continue;

            string outputPath = Path.Combine(targetPath, entry.FileName.Split(new []{ '/'}).Last());

            using (var output = File.Open(outputPath, FileMode.Create, FileAccess.ReadWrite))
            {
                while ((n = input.Read(buffer, 0, buffer.Length)) > 0)
                {
                    output.Write(buffer, 0, n);
                }
            }
        }
    }
}

kamran1331 avatar Dec 21 '16 17:12 kamran1331

Either it's a bug or it's actually a corrupt zip file. The source code is available for you to research with, but unfortunately there's no paid (or free) support available for this library.

I've formatted the code for you. If it's a bug then what you've given is enough for someone to fix it, as long as you don't remove your zipfile from your dropbox.

haf avatar Dec 22 '16 10:12 haf

Hi @kamran1331 did you resolve this in the end? @yyjdelete did your changes ever make it into the library or did you fix it in a different way?

We've found a similar problem but just trying to isolate it down at the moment (it might not be a problem with the library, might be our own code).

AlexKeySmith avatar Sep 21 '18 12:09 AlexKeySmith

Cool, so in our case it was simply because we were migrating some code and we forgot what archive format we'd used originally when creating test files n.b. 7zip / LZMA2 with AES-256 didn't work, but the defaults for zip worked for us... just in case anyone else gets this error, it could be user error!

AlexKeySmith avatar Sep 21 '18 12:09 AlexKeySmith

Bu sehvin hellini tapmisanmi mende de bu sehvi verir

ZohraGurbanova avatar Jan 13 '20 12:01 ZohraGurbanova