This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File download in struts2

 
Vallaru smitha
Ranch Hand
Posts: 87
Firefox Browser Hibernate Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

JSP

Action Class



Struts.xml



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

thanks
 
Joe Ess
Bartender
Posts: 9279
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at StreamResult. You can override the contentDisposition by specifying a getter in your action and provide the filename there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic