This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes failed to unzip uploaded file with ZipInputStream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "failed to unzip uploaded file with ZipInputStream" Watch "failed to unzip uploaded file with ZipInputStream" New topic
Author

failed to unzip uploaded file with ZipInputStream

Michael An
Greenhorn

Joined: Oct 27, 2013
Posts: 3
Hi,

I'm using Appache FileUpload lib to upload zip file and then unzip it and read the content of files in it on server side. I didn't get through it. I tried unzipping the same zip file with Java application program successfully. On server program, the entry name returned for a file entry is not purely file name, it contains kind of compressed content something like following


Once I tried to thereafter read content from the entry, i got exception 'java.util.zip.ZipException: invalid code lengths set'. Please note the same zip file works fine with Java application program. Following are two code blocks for processing the zip file with ZipInputStream.

Code in Java application program


code on Tomcat server processing the zip file with Appache FileUploader


Your help is really appreciated.

Thanks,
Michael
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8

Welcome to the Ranch.

Can you please copy paste the full stack trace?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Michael An
Greenhorn

Joined: Oct 27, 2013
Posts: 3
Here is the stack trace.

Michael An
Greenhorn

Joined: Oct 27, 2013
Posts: 3
i found the problem. it's due to a request wrapper change that checks the size of the request body.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: failed to unzip uploaded file with ZipInputStream
 
Similar Threads
Character Encoding
Exception
Unable to open zip file in filesystem retrived from sybase database
Decompress the HTTP Request body
UnZIPPing Exception