tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey Janner <>
Subject IE 8 and before refusing to download files (I hate IE)
Date Mon, 03 Jun 2013 18:00:47 GMT
Ran into an interesting problem today.  It seems that IE8 and before no longer likes how we
are sending BLOB files.
Worked last week as far as we can tell.  Works fine for IE9+ and other browsers, but IE8 is
suddenly giving us an error message, as though it is ignoring the response headers.
I'm not going to completely rule out the possibility it is in our code somewhere, but we haven't
found it yet.  We did also upgrade out app over the weekend, but the problem didn't show up
in our test environment (as far as we can tell).
Here is the relevant code:

    protected void viewAction(ServletContext ctx, HttpServletRequest req, HttpServletResponse
            throws ServletException, IOException, PolyError {
        // Get beans
        ReportDashboardBean bean = (ReportDashboardBean) session.getAttribute(SessionConstants.REPORT_DASHBOARD_BEAN);

        // get request data
        int row = userBean.getLongValue(req, "ROW").intValue();
        ReportContentBean conBean = (ReportContentBean) bean.getContentList().get(row);

        //System.out.println("*** " + conBean.getFilename(false));

        StringBuilder sbContentDisposition = new StringBuilder();
        if (conBean.getDbObject().getMimeType().indexOf("text/html") >= 0) {
            sbContentDisposition.append("inline; ");  // streamline output automatically
        } else {
            sbContentDisposition.append("attachment; ");  // ask user to "open" or "save"

        rsp.setHeader("Content-Disposition", sbContentDisposition.toString());

Works great if the MimeType is text/html, but anything else generates an error.
The getContent routine reads from the BLOB and copies it to the response output stream.
None of this code has changed, and the access log shows a 200 response and the full number
of bytes of the file.

Anybody have any ideas?

Server1 specs: Tomcat 6.0.33/Java 1.6.0_33/Windows 2003 SP2
Server2 specs: Tomcat 6.0.36/Java 1.6.0_34/Windows 2008 R2/SP1

Jeffrey Janner
Sr. Network Administrator<>
PolyDyne Software Inc.
Main:   512.343.9100
Direct:  512.583.8930


Speed, Intelligence & Savings in Sourcing

  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message