aspose file tools*
The moose likes Struts and the fly likes multiple file export as zip file (using DownloadAction class in struts) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "multiple file export as zip file (using DownloadAction class in struts)" Watch "multiple file export as zip file (using DownloadAction class in struts)" New topic
Author

multiple file export as zip file (using DownloadAction class in struts)

Chrix Wu
Ranch Hand

Joined: Nov 15, 2009
Posts: 121
Hi folks, I have a set of files store in db as blob type , and i need to export all these files as zip file using DownloadAction.

I know how to export each file one by one, i just need to override the DownloadAction.StreamInfo inner class, and returns the input stream of blob file,

but what about zip ? can anyone suggest the way to do this? thanks!


** SCJP 5.0 84% **
** SCWCD 1.5 76% **
Chrix Wu
Ranch Hand

Joined: Nov 15, 2009
Posts: 121
the solution i saw on the web is about packing existing files as zip.

is there a solution that, i can accepts a set of streams ?
Thai C. Tran
Greenhorn

Joined: Jul 05, 2009
Posts: 26
Have you tried package java.util.zip ? http://www.exampledepot.com/egs/java.util.zip/CreateZip.html
Chrix Wu
Ranch Hand

Joined: Nov 15, 2009
Posts: 121
Thai C. Tran wrote:Have you tried package java.util.zip ? http://www.exampledepot.com/egs/java.util.zip/CreateZip.html


Hi, thanks for you reply.

I have read the example, but is that means i need to do following:
1. transforms the blob data in the database to a set of files?
2. then packs the files into zip?

is there a way to avoid creating the files, and creates only the zip file
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: multiple file export as zip file (using DownloadAction class in struts)