Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Corrupted zip or bug: expected 19 records in central dir, got 0 #892

Open
andrewvarga opened this issue Mar 31, 2023 · 4 comments
Open

Comments

@andrewvarga
Copy link

I tried this library and it works well for most zip files but there is one which produced the above error:
Unzipping error: Error: Corrupted zip or bug: expected 19 records in central dir, got 0

However I seem to be able to uncompress the zip on my mac simply by double clicking it, so I think the file is ok?
Is this something that maybe jszip doesn't support?
I can upload the file somewhere if it helps (~45Mb). Thank you.

@manbaum
Copy link

manbaum commented May 12, 2023

I got the similar error message, but I'm not sure if it's the same issue.
Error: Corrupted zip or bug: expected 1 records in central dir, got 0

This error can be reproduced by trying unzip the file created through the following command:
cat a-text-file | zip output.zip -

We also can put multiple records into the zip archive by using the following command:
cat a-text-file | zip output.zip - file1 file2

Unzip the file output.zip through jszip will get the the following error message:
Error: Corrupted zip or bug: expected 3 records in central dir, got 0

@manbaum
Copy link

manbaum commented May 19, 2023

I found that if I commented out the line 240 of the file lib/zipEntries.js, everything would be fine. The original line was:
this.reader.zero = extraBytes;

But I am not sure if this modification causes other errors.

@oleksiy-nesterov
Copy link

any news? same error

@jayantpaliwal
Copy link

same issue.Corrupted zip or bug: expected 1 records in central dir, got 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants