This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I upload a File using Struts

 
Rakesh Narayanan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I upload a File using Struts
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sean Sullivan
Ranch Hand
Posts: 427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote a Struts application that demonstrates File Upload and File Download:

http://strutsblobapp.sourceforge.net/

Cheers,

-Sean
 
George Franciscus
author
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic