struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raghuveer" <raghuve...@infotechsw.com>
Subject DownloadAction in Struts 1.2.8
Date Tue, 11 Jul 2006 14:06:04 GMT
When using download  Action 2 Dialogue Windows are opening.
Is it wrong in adding
 response.setHeader("Content-Disposition.........


---------------------------------------
    protected StreamInfo getStreamInfo(ActionMapping mapping,
            ActionForm form, HttpServletRequest request,
            HttpServletResponse response)
            throws FileNotFoundException,CAcsException,Exception {
...........

............
ServletContext servletContext = getServlet().getServletContext();
        strTemplatePath =
servletContext.getResource(strTemplateDirName).getPath();
        file  = new File(strTemplatePath+strFileName);

        strContentType =servletContext.getMimeType(strTemplatePath);
        response.setHeader("Content-Disposition","attachment;filename=\"" +
strFileName + "\"");    // set header information

        return new FileStreamInfo(strContentType, file);

............

.............
}


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message