Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 83289 invoked from network); 26 Mar 2009 12:20:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Mar 2009 12:20:52 -0000 Received: (qmail 72691 invoked by uid 500); 26 Mar 2009 12:20:48 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 72653 invoked by uid 500); 26 Mar 2009 12:20:48 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 72643 invoked by uid 99); 26 Mar 2009 12:20:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Mar 2009 12:20:48 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [12.4.199.71] (HELO exchange-server.pqa.com) (12.4.199.71) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Mar 2009 12:20:42 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: file download problem in application server Date: Thu, 26 Mar 2009 08:20:19 -0400 Message-ID: <0C36D9C74ADA844292F3218A9C63454404E42CAD@exchange.pqa.local> In-Reply-To: <0C36D9C74ADA844292F3218A9C63454404E4290A@exchange.pqa.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: file download problem in application server Thread-Index: AcmuDTpd/y0g2GvGQ1O8rkjxZmXOcA== References: <0C36D9C74ADA844292F3218A9C63454404E4290A@exchange.pqa.local> From: "Shannon, Andrew" To: X-Virus-Checked: Checked by ClamAV on apache.org I was half wrong. It was a quirk for runnnig in OC4J but the Blob was being mangled coming out of the data base (which I had previously ruled out, doh). Adding a property to the hibernate.properties file for: hibernate.jdbc.use_streams_for_binary=3Dtrue fixed my problem. Otherwise file handling in struts 2 is a snap. So thanks for that. -----Original Message-----=20 Sent: Wednesday, March 25, 2009 9:26 AM To: user@struts.apache.org Subject: file download problem in application server I posted this question on the OTN - OC4J list a second ago, but am hoping someone here might have some insight. =20 "I have a web app running in an OC4J stand alone 10.1.3.3 and am having a problem with downloading files over http. Its a struts2 app whose file downloading impl is easy to use and standard code for writing to an http servlet response output stream. Using the firefox plugin for Live Headers I can see that the headers are correctly added to the servlet response and I do get the file I want. However the file has been mangled with binary output around the text. This is the case for txt, word, or any other file. This problem does not occur in Jetty or Tomcat. I've also ruled out file corruption while going in/out of the database since I can upload a file when running oc4j, turn off oc4j, start up my app in Jetty and retrieve the same file just fine. The mime types are all accounted for and the problem exists regardless if I use a specific content type or just application/download. My browsers (firefox and ie) also recognize all files from the content disposition value "attachment; filename=3Dmyfilename.ext". Its just the file content that some how has been wrecked on the way out of the container. Has anyone experienced this? I only found one or two unanswered posts elsewhere. How can this be mitigated?" =20 What I didn't include in the above post is that we're on s2 2.0.14, also that I put on my pirate hat and created a custom result type based on the StreamResult so that I could specifically set some additional response headers. It all works great in a servlet container, but I'd like to know if you all have seen this problem in application servers like oc4j or jboss and if so what did you do to fix it? I'm open to any suggestions. =20 Thanks a bunch, Andrew =20 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org