This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes File download in struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "File download in struts2" Watch "File download in struts2" New topic

File download in struts2

Vallaru smitha
Ranch Hand

Joined: Aug 19, 2008
Posts: 87

Hi ,

I am downloading file in struts2 . while downloading the file should save with same name as while uploading. could any help me how to get that.


Action Class


What should be written in contentDisposition to save with same file as uploading

Joe Ess

Joined: Oct 29, 2001
Posts: 8834

Have a look at StreamResult. You can override the contentDisposition by specifying a getter in your action and provide the filename there.

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
wood burning stoves
subject: File download in struts2
Similar Threads
struts2 properties file reload
how to download a file in struts2
downloading a file struts2
Struts2 <s:iterator /> question
passing values from struts2 form to javascript