wood burning stoves 2.0*
The moose likes Struts and the fly likes how to download a file in struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to download a file in struts2" Watch "how to download a file in struts2" New topic
Author

how to download a file in struts2

sathya rajavel
Greenhorn

Joined: May 30, 2011
Posts: 8

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

Joined: Mar 08, 2011
Posts: 188

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to download a file in struts2