Mailing List
Subject: RE: Downloading file rendered in JSP
Thanks for that.
I actually just needed to implement the ServletResponseAware interface
to access the servlet response properly.
Trying to set those in the JSP (through a scriplet) didn't work, but
indeed doing it in the action is
ailto:[EMAIL PROTECTED]
Sent: 08 April 2008 14:25
To: Struts Users Mailing List
Subject: RE: Downloading file rendered in JSP
To set the download file name, in addition to the "text/csv" mime type
(which you already have set), write the following java code in your
Action or (if necessary)
To set the download file name, in addition to the "text/csv" mime type
(which you already have set), write the following java code in your
Action or (if necessary) as Java in your JSP:
response.setHeader("Content-disposition", "attachment; filename=" +
CSV_FILE_NAME);
where CSV_FILE_NAME is the n
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-Ty
On 11/3/06, Balwinder <[EMAIL PROTECTED]> wrote:
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.
On 11/3/06, Balwinder <[EMAIL PROTECTED]> wrote:
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.
A
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?"
7 matches
Mail list logo