Win a copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

How can I upload a File using Struts

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I upload a File using Struts
 
author
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.
 
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
 
author
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
 
Because those who mind don't matter and those who matter don't mind - Seuss. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!