• Post Reply Bookmark Topic Watch Topic
  • New Topic

Download a csv file  RSS feed

 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a jsp file...in that page..i have a link that should allow me to download a file...

But when the user clicks on the link...i want only the file download diaglog to popup...

i dont want the user to be taken to any other page....Also the download link...cant have the actual path of the file..

the file...path...etc resides in the server..side code...

Regards
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the JspAndExcel example in the JSP FAQ.
It does this.

In particular, look at the code that sets the Content-Disposition header.
In addition to holding the suggested file name, it can hold either the "attachment" or "inline" keywords. The first suggests that the browser prompt the user with a "Save As / Open With" dialog box. The second suggests that the browser open the associated application right in the browser window.
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ben!!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!