This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Uploading a ZIP file question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Uploading a ZIP file question" Watch "Uploading a ZIP file question" New topic

Uploading a ZIP file question

A Harry
Ranch Hand

Joined: Jan 23, 2002
Posts: 124
I have managed to upload a ZIP file using Struts 1.1 to my server & can save it to disk there quite easily like so -

public ActionForward execute(ActionMapping mapping, ActionForm form,.......
DynaActionForm frm = (DynaActionForm) form;
FormFile uploadFile = (FormFile)frm.get("uploadfile");
byte[] fileData = uploadFile.getFileData();
FileOutputStream os = new FileOutputStream("");

the file contains a text.txt file

What I want to do is open the ZIP file in memory & process the contents of test.txt WITHOUT having to save it to disk!

Is this possible? if so any help would be greatly appreciated!


Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
It's possible. Just use the classes in the package. You can use the FormFile's getInputStream() method to get an input stream for the file and use it to create in instance of

Here's an article that gives you some examples:

Consultant, Sima Solutions
I agree. Here's the link:
subject: Uploading a ZIP file question
Similar Threads
FileUploading in struts1.1
How to set file download location in struts ??
File upload in struts
How to upload a file to sql server database using struts
how to store image object