How to Put a downloadable link on jsp
Hi All,
I need to put a downloadable link on a jsp.On clicking it user should be able to save/open/cancel the document.
I tried giving <a href="path">download</a>.On cliking the link the content of the document is parsed in to the browser itself.
I need to put a excel document there.
Please suggest me in this regard.
Thanks
Kalyan M
[383 byte] By [
SecfGuya] at [2007-11-27 10:23:16]

Is the Excel file static or dynamic content? In other words, is the file sitting on your server somewhere, or does the link actually go to a servlet that generates the file on the fly?
If the latter, then you need to set the Content-Type header explicitly in the response. Look here for more info: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
If it's static content, then the server itself needs to be configured to send the correct type. This is very dependent on the server you're using.
Look here if you're using Apache as a front end: http://httpd.apache.org/docs/2.2/content-negotiation.html
If you're using another server, Google for configuring static mime types on that server.
Then, look here to see what mime type you'll want to use: http://www.w3schools.com/media/media_mimeref.asp