• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

failed to unzip uploaded file with ZipInputStream

 
Michael An
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Can you please copy paste the full stack trace?
 
Michael An
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the stack trace.

 
Michael An
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i found the problem. it's due to a request wrapper change that checks the size of the request body.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic