Invalid zip file coming through from applet

Upload core product.
Post Reply
ajassal
Posts: 11
Joined: Sun May 11, 2008 4:27 pm

Invalid zip file coming through from applet

Post by ajassal »

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?

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Invalid zip file coming through from applet

Post by support »

You'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 ?

Post Reply