-
Notifications
You must be signed in to change notification settings - Fork 313
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
ZipException: File header and local file header mismatch #363
Comments
The problem entry in the zip is this file: |
The zip is created to mimic the issue. Unfortunately, I cannot share the original zip. During debugging, I observed the exception being thrown when filename has special character. Also, local file headers are being set correctly, but file headers are believed to be truncated(as seen in intellij), but I am not sure. |
Which character exactly was it in your case? |
In mac OS, the name of this file is being shown as "Co/\nfig". However, I am able to unzip the zipfile with IOS unzip software, but not with zip4j. |
Fixed in v2.9.1 released today. |
Hi, I have created zip using zip4j and it is failing with the mentioned exception during unzipping.
Zip file is created using following code
File outputFile = new File(zipFile);
outputFile.getParentFile().mkdirs();
ZipFile outputZippedFile = new ZipFile(zipFile);
ZipParameters zipParameters = new ZipParameters();
zipParameters.setSymbolicLinkAction(ZipParameters.SymbolicLinkAction.INCLUDE_LINK_ONLY);
outputZippedFile.addFolder(new File(sourceFolder), zipParameters);
I have been able to unzip it using other tools, but getting exception with Zip4j. Attaching zip file for reference
zipFile.zip
The text was updated successfully, but these errors were encountered: