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

Zip Files Do Not Unzip on Mac OS #6

Closed
richardanaya opened this issue Feb 21, 2012 · 9 comments
Closed

Zip Files Do Not Unzip on Mac OS #6

richardanaya opened this issue Feb 21, 2012 · 9 comments

Comments

@richardanaya
Copy link

They unzip fine from the command line.

But when I double click to unzip in mac Finder, they give me an error message

"Unable to expand "Project (2).zip" into "Downloads"
(error 2 - No such file or directory)

I verified this on two machines.

@richardanaya
Copy link
Author

Here's some commandline info on fixing it ( http://ask.metafilter.com/157754/Mac-OS-X-Recovering-a-corrupted-zip-file )

Jaundiced-Outlook:Downloads Richard$ file Project.zip
Project.zip: Zip archive data, at least v1.0 to extract
Jaundiced-Outlook:Downloads Richard$ zip -F Project.zip --out ProjectFixed.zip
Fix archive (-F) - assume mostly intact archive
zip warning: bad archive - missing end signature
zip warning: (If downloaded, was binary mode used? If not, the
zip warning: archive may be scrambled and not recoverable)
zip warning: Can't use -F to fix (try -FF)

zip error: Zip file structure invalid (Project.zip)
Jaundiced-Outlook:Downloads Richard$ zip -FF Project.zip --out ProjectFixed.zip
Fix archive (-FF) - salvage what can
zip warning: Missing end (EOCDR) signature - either this archive
is not readable or the end is damaged
Is this a single-disk archive? (y/n): y
Assuming single-disk archive
Scanning for entries...
copying: Project/after.png
zip warning: no end of stream entry found: Project/after.png
zip warning: rewinding and scanning for later entries
zip warning: zip file empty
Jaundiced-Outlook:Downloads Richard$

@gildas-lormeau
Copy link
Owner

Thanks richardanaya for this detailed bug report!

Actually I fixed a bug related to "Data descriptor" signature recently. Did you use the latest version of zip.js?

@richardanaya
Copy link
Author

Just tried with latest git clone.

Same message and same output from zip -FF =)

@gildas-lormeau
Copy link
Owner

I do not see what is wrong with the end of central directory record...
Can you attach a lightweight zip file that you are not able to unzip? Are there some cases where the generated zip files can be unzipped without any issue?

EDIT: Can you also try to replace this code at line 792 of zip.js
header.view.setUint32(0, 0x0a000808);
with this one:
header.view.setUint32(0, 0x14000808);

(edit 2: changed 0x3d000808 to 0x14000808)

@richardanaya
Copy link
Author

Will do

@gildas-lormeau
Copy link
Owner

Thank you very much :)

That's the only way for me to know how to fix this issue...

@richardanaya
Copy link
Author

Edit! Correction, they all seem to be working!

I'm going to link a directory of tests, basically I just browse to the directory and add all the files using the "Create a zip file demo"

http://www.mediafire.com/?58dami1ka95sodi

Test 1: 1 image file
Test 2: 2 image files
Test 3: 1 .rtf file
Test 4: 4 image files

Pre-Fix
Test 1: Fails
Test 2: Succeeds
Test 3: Fails
Test 4: Succeeds

Post Fix:
Test 1: Succeeds
Test 2: Succeeds
Test 3: Succeeds
Test 4: Succeeds

@richardanaya
Copy link
Author

Whoops, guess should wait til there is a code fix =)

@gildas-lormeau
Copy link
Owner

Yeah, I'll push it when I'll be back at home ;)

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

2 participants