Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to download a file in struts2

 
sathya rajavel
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hai

I have created a file upload and i make the uploaded file to save in folder.

Now once it get uploaded i created a hyperlink by clicking on the link it should get download please send me the full code for download

Cheers,
Sathya.
 
debraj mallick
Ranch Hand
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi sathya,

the way you upload a file, is same as downloading the file

this is an example of downloading a pdf file (name = sathya.pdf)
hope this link would help you
http://struts.apache.org/2.1.2/struts2-core/apidocs/org/apache/struts2/dispatcher/StreamResult.html#contentDisposition
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic