You must use content-disposition header :
response.setHeader("Content-Disposition", "attachment;
filename=\""+myfilename+"\"");
You can also add a mime type with something like
String mimeType = getServletContext().getMimeType(myfilename);
response.setHeader("Content-Type",
mimeType==null?"x-type/unknown":mimeType);
Mike
Balwinder a écrit :
Hi All,
I am developing an application in struts in which I needed to download
a file from a server. When iam clicking on download button, file lose
its extension and it with the action ie .do and does not open with the
associated application.
Any help is highly appreciated.
Thanks in advance.
Thanks and Regards,
Balwinder Kumar
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Mike Baroukh
---
Cardiweb - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: [EMAIL PROTECTED]
http://www.cardiweb.com
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]