A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Arduino in Action
this week in the
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
Uploading a ZIP file question
Joined: Jan 23, 2002
Mar 08, 2006 10:30:00
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();
os = new
the test.zip 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!
Joined: Feb 15, 2005
Mar 08, 2006 12:12:00
It's possible. Just use the classes in the java.util.zip 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:
I agree. Here's the link:
- it saves me about five hours per week
subject: Uploading a ZIP file question
How to set file download location in struts ??
how to store image object
How to upload a file to sql server database using struts
File upload in struts
FileUploading in struts1.1
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013