File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes UploadImage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "UploadImage" Watch "UploadImage" New topic


Adithya Menon

Joined: Jan 21, 2007
Posts: 19
Hi friends,
I need to upload image file to webserver(and save it) from the
webbrowser using struts.Please help
thanks in Advance

SCJP1.4(96%) SCWCD1.4(92%)
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
On the client side you need a file upload form field, while the server side can be handled be a library like Jakarta Commons FileUpload; see this page for further links.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
In Struts you do this with a combination of the <html:file> tag and a property of type FormFile in your Actionform bean. The best way to learn how to do it is by examining the upload example in the examples war file that comes with the Struts download.

Consultant, Sima Solutions
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
There is also a very good article...just go to Google, type in "struts file upload" (no quotes) and click the I'm Feeling Lucky button.

- Brent
I agree. Here's the link:
subject: UploadImage
It's not a secret anymore!