aspose file tools*
The moose likes Struts and the fly likes How can I upload a File using 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 "How can I upload a File using Struts" Watch "How can I upload a File using Struts" New topic
Author

How can I upload a File using Struts

Rakesh Narayanan
Greenhorn

Joined: Sep 07, 2004
Posts: 1
How can I upload a File using Struts
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
With <html:file/>. You need to use the <html:file/> element inside a <html:form/> on the JSP and have a corresponding setter/getter in your ActionForm class with the type org.apache.struts.upload.FormFile.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Sean Sullivan
Ranch Hand

Joined: Sep 09, 2001
Posts: 427
I wrote a Struts application that demonstrates File Upload and File Download:

http://strutsblobapp.sourceforge.net/

Cheers,

-Sean
George Franciscus
author
Ranch Hand

Joined: Jan 25, 2005
Posts: 32
Check out Struts Recipes, chapter 2, recipe 2.9, Upload a File, p 89 (p 51 in the pdf). This recipe explains how to do it and "gotcha"s.

http://www.manning-source.com/books/franciscus/franciscus_chp2.pdf

~~George


George Franciscus<br />george.franciscus@nexcel.ca<br /><a href="http://www.nexcel.ca" target="_blank" rel="nofollow">http://www.nexcel.ca</a><br /><a href="http://www.manning.com/franciscus" target="_blank" rel="nofollow">http://www.manning.com/franciscus</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I upload a File using Struts