We are using the zip feature of jfileupload to compress files before uploading to the server.
In some cases an erroneous zip file comes through. This results in an exception similar to the following:
java.util.zip.ZipException: invalid END header (bad central directory offset)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:114)
...
On command line:
$ zipinfo /tmp/insideflap.zip
[/tmp/insideflap.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
zipinfo: cannot find zipfile directory in one of /tmp/insideflap.zip or
/tmp/insideflap.zip.zip, and cannot find /tmp/insideflap.zip.ZIP, period.
I am able to reproduce this type of error when the zip output stream is not closed (in a test program). It is ok when zipentry, zipoutputstream and FileOutputStream all are properly closed.
Can you confirm that this is not an issue within jfileupload?
Invalid zip file coming through from appletRe: Invalid zip file coming through from appletYou're the first one to report such issue. What is the size of the file you compress ?
Are you able to reproduce it each time ? Could you provide step-by-step instructions to reproduce here ? Also, could you make a test with the GZIP compression instead ? Finally, do you have an anti-virus installed ? |