Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to force download of a link in a jsp page ?  RSS feed

 
Francesco Marchioni
author
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have a jsp page with links built at runtime (scanning
a directory).
I'd like to know how you can force download of
links (such as excel, word and pdf files). I can see
that if the application is installed on the pc, the
browser tries to open the file in the browser.
I'd like rather to force the download as you click on the file.
Thanks a lot
Francesco
 
Anthony Watson
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's some old code I wrote. It should do the job.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!