Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!