File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes Zip file creation and problems unzipping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Zip file creation and problems unzipping" Watch "Zip file creation and problems unzipping" New topic
Author

Zip file creation and problems unzipping

Donna Reschke
Greenhorn

Joined: Jul 05, 2001
Posts: 23
I am using the java.util.zip.ZipOutputStream to create a zip file. I store it on a server and then invoke a script file that ftp's this zip file to our mainframe environment where a COBOL program tries to unzip it with PKUnzip. Each time they try to unzip my zip file they get an "invalid zip archive" error. But I am able to unzip it with WinZip. Does anyone have any experience with this or know of anything I can do differently? I've put a code snippet of how I zip the text file below.
Thanks, Donna

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41106
    
  45
Are you certain that PKUnzip can handle Deflater.DEFAULT_COMPRESSION?

Here is a canonical example of how to create ZIP files.


Ping & DNS - my free Android networking tools app
Donna Reschke
Greenhorn

Joined: Jul 05, 2001
Posts: 23
Well I ended up commenting out the "setLevel" instruction which I'm not sure if that was causing part of the problem or not. The real issue was that I wasn't specifying "binary" when I ftp'd the file to the mainframe. ONce I did that, the COBOL program was able to unzip the file.
Thanks!
Donna
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Zip file creation and problems unzipping
 
Similar Threads
OutOfMemoryError when downloading files
Losing newlines in text file when zipping
Zippy
zip file bug?
Tomcat cannot unzip a War file