Mike Baroukh wrote:


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]



------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Thanks a lot!!Iam through this  problem, it is working now.

Thanks and Regards,
Balwinder Kumar

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to