This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Force file download

 
Arun Kumar
Ranch Hand
Posts: 133
Chrome Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to give the user an option to download a csv file I have created a link which points to this file in the server but when user clicks on the link rather than downloading the file the csv file is displayed in the browser


We are following FrontServlet Architecture hence Streaming the file as the response or response.setHeader is not working

please help
 
Vinoth Thirunavukarasu
Ranch Hand
Posts: 164
Android Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Arun the bellow link will help you
Example
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The key is that you need to set the content-disposition response header to "attachment".
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic