Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 13F05CD6F for ; Mon, 3 Jun 2013 18:01:30 +0000 (UTC) Received: (qmail 1420 invoked by uid 500); 3 Jun 2013 18:01:25 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 1296 invoked by uid 500); 3 Jun 2013 18:01:24 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 1249 invoked by uid 99); 3 Jun 2013 18:01:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jun 2013 18:01:23 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [66.219.55.137] (HELO mail.polydyne.com) (66.219.55.137) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jun 2013 18:01:18 +0000 Received: from Unknown [10.1.1.19] by mail.polydyne.com - Websense Email Security (7.2.0); Mon, 03 Jun 2013 13:07:39 -0500 Received: from POSTOFFICE02.polydyne.com ([::1]) by POSTOFFICE02.polydyne.com ([::1]) with mapi id 14.01.0438.000; Mon, 3 Jun 2013 13:00:49 -0500 From: Jeffrey Janner To: 'Tomcat Users List' Subject: IE 8 and before refusing to download files (I hate IE) Thread-Topic: IE 8 and before refusing to download files (I hate IE) Thread-Index: Ac5ghEcJkMsnm7mJTziKjVkFyUAKWQ== Date: Mon, 3 Jun 2013 18:00:47 +0000 Message-ID: <7215BA462D00D343B2837F9113F0131F016FCABDCB@POSTOFFICE02.polydyne.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.1.1.27] Content-Type: multipart/related; boundary="_004_7215BA462D00D343B2837F9113F0131F016FCABDCBPOSTOFFICE02p_"; type="multipart/alternative" MIME-Version: 1.0 X-SEF-7853D99-ADF1-478E-8894-213D316B8FFA: 1 X-SEF-Processed: 7_2_0_00504__2013_06_03_13_07_41 X-Virus-Checked: Checked by ClamAV on apache.org --_004_7215BA462D00D343B2837F9113F0131F016FCABDCBPOSTOFFICE02p_ Content-Type: multipart/alternative; boundary="_000_7215BA462D00D343B2837F9113F0131F016FCABDCBPOSTOFFICE02p_" --_000_7215BA462D00D343B2837F9113F0131F016FCABDCBPOSTOFFICE02p_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Ran into an interesting problem today. It seems that IE8 and before no lon= ger likes how we are sending BLOB files. Worked last week as far as we can tell. Works fine for IE9+ and other brow= sers, but IE8 is suddenly giving us an error message, as though it is ignor= ing the response headers. I'm not going to completely rule out the possibility it is in our code some= where, but we haven't found it yet. We did also upgrade out app over the w= eekend, but the problem didn't show up in our test environment (as far as w= e can tell). Here is the relevant code: protected void viewAction(ServletContext ctx, HttpServletRequest req, H= ttpServletResponse rsp) throws ServletException, IOException, PolyError { // Get beans ReportDashboardBean bean =3D (ReportDashboardBean) session.getAttri= bute(SessionConstants.REPORT_DASHBOARD_BEAN); // get request data int row =3D userBean.getLongValue(req, "ROW").intValue(); ReportContentBean conBean =3D (ReportContentBean) bean.getContentLi= st().get(row); //System.out.println("*** " + conBean.getFilename(false)); rsp.setContentType(conBean.getDbObject().getMimeType()); StringBuilder sbContentDisposition =3D new StringBuilder(); if (conBean.getDbObject().getMimeType().indexOf("text/html") >=3D 0= ) { sbContentDisposition.append("inline; "); // streamline output = automatically } else { sbContentDisposition.append("attachment; "); // ask user to "o= pen" or "save" content } sbContentDisposition.append("filename=3D").append(conBean.getFilena= me(false)).append(";"); rsp.setHeader("Content-Disposition", sbContentDisposition.toString(= )); conBean.getDbObject().getContent(rsp.getOutputStream()); } Works great if the MimeType is text/html, but anything else generates an er= ror. The getContent routine reads from the BLOB and copies it to the response ou= tput 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 jeffrey.janner@polydyne.com PolyDyne Software Inc. Main: 512.343.9100 Direct: 512.583.8930 [cid:image002.png@01CC0FB7.4FF43CE0] Speed, Intelligence & Savings in Sourcing --_000_7215BA462D00D343B2837F9113F0131F016FCABDCBPOSTOFFICE02p_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Ran into an interesting problem today.  It seem= s 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 erro= r 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 als= o upgrade out app over the weekend, but the problem didn't show up in our t= est environment (as far as we can tell).

Here is the relevant code:

 

 

    protected void viewAction(Servlet= Context ctx, HttpServletRequest req, HttpServletResponse rsp)

        &nbs= p;   throws ServletException, IOException, PolyError {=

        // Get be= ans

        ReportDas= hboardBean bean =3D (ReportDashboardBean) session.getAttribute(SessionConst= ants.REPORT_DASHBOARD_BEAN);

 

        // get re= quest data

        int row = =3D userBean.getLongValue(req, "ROW").intValue();

        ReportCon= tentBean conBean =3D (ReportContentBean) bean.getContentList().get(row);

 

        //System.= out.println("*** " + conBean.getFilename(false));<= /p>

 

        rsp.setCo= ntentType(conBean.getDbObject().getMimeType());

        StringBui= lder sbContentDisposition =3D new StringBuilder();

        if (conBe= an.getDbObject().getMimeType().indexOf("text/html") >=3D 0) {<= o:p>

        &nbs= p;   sbContentDisposition.append("inline; ");  // = streamline output automatically

        } else {<= o:p>

        &nbs= p;   sbContentDisposition.append("attachment; "); = // ask user to "open" or "save" content

        }

        sbContent= Disposition.append("filename=3D").append(conBean.getFilename(fals= e)).append(";");

 

        rsp.setHe= ader("Content-Disposition", sbContentDisposition.toString());

        conBean.g= etDbObject().getContent(rsp.getOutputStream());

   }

 

Works great if the MimeType is text/html, but anythi= ng else generates an error.

The getContent routine reads from the BLOB and copie= s it to the response output stream.

None of this code has changed, and the access log sh= ows 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 2= 003 SP2
Server2 specs: Tomcat 6.0.36/Java 1.6.0_34/Windows 2008 R2/SP1

 

 

Jeffrey Janner

Sr. Network Administrato= r

jeffrey.janner@polydyne.com

PolyDyne Software Inc.=

Main:   512.343.910= 0

Direct:  512.583.89= 30  

 =

 3D"cid:image002.png@01CC0FB7.4FF43CE0"

=  

Speed, Intelligence= & Savings in Sourcing

 

--_000_7215BA462D00D343B2837F9113F0131F016FCABDCBPOSTOFFICE02p_-- --_004_7215BA462D00D343B2837F9113F0131F016FCABDCBPOSTOFFICE02p_--