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 Java in General and the fly likes creating a zip file 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 » Java in General
Bookmark "creating a zip file" Watch "creating a zip file" New topic
Author

creating a zip file

praveen shinde
Ranch Hand

Joined: Jun 03, 2009
Posts: 63
Hello friends,
I am creating a zip file from a string.In the code below zipOS is creating a zip file with an entry of rama.txt. But I am not understanding how to give a name to the resulting zip file. Any help is most welcome.

Thanks





Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41034
    
  43
Instead of writing to a ByteArrayOutputStream the code should write to a FileOutputStream.


Ping & DNS - my free Android networking tools app
praveen shinde
Ranch Hand

Joined: Jun 03, 2009
Posts: 63
hi Ulf Dittmer,
Ok, I will try that out.
Thanks & regards,
Praveen
praveen shinde
Ranch Hand

Joined: Jun 03, 2009
Posts: 63
Thanks Dittmer,
I am getting the zip file (with a name which I am giving in the code).

Regards,
Praveen.
 
jQuery in Action, 2nd edition
 
subject: creating a zip file
 
Similar Threads
ZipOutputStream
How to zip the contents inside a directory
Document doc => xml => blob at mySQL
Sending ZIP file over httpResponse
Windows XP Compressed Folders doesn't recognize my Java-created zip file