[Opensource] File downloads
Wise, Malcolm
Malcolm.Wise at eu.sony.com
Wed Apr 14 00:01:26 PDT 2004
Vincent,
Try calling
HttpServletResponse.reset()
before setting the headers. The below posting was mine and this solved this
particular problem :)
Cheers,
Malc
-----Original Message-----
From: Vincent Gogan [mailto:vincent.gogan at goganinc.com]
Sent: 14 April 2004 03:38
To: opensource at jcorporate.com
Subject: RE: [Opensource] File downloads
Perhaps my problem is related to these earlier postings. My
issue relates to inline display of PDF's in IE6.
I battled this a while ago and decided that the only cross-browser
thing to do was to set the Content-Disposition to "attachment" and
let the user decide to open/save.
This recently came back to bite me as we have users who specifically
want the plugin to be used. Now, setting the Content-Disposition to
"inline" seems to work in IE6 but I get a really nasty error message
from the plugin saying:
"There was an error opening the document. The file is damaged
andcould not be repaired."
I am conditionally delivering the pdf file and use "setCustomResponse()"
to control the response. I then write the stream as the PDF is, in some
sense, dynamic.
After lots of Google searches and experimenting, I'm down to two
ideas:
1. The plugin uses the 'range' header to selectively download
portions of the file. The DefaultServlet would handle this (which
would explain why the plugin can view static files) but perhaps
this is not supported in the Struts/Expresso mechanism.
I can't see any 'range' header but perhaps this is part of the
problem.
2. Setting cookies screws up the plugin.
I've already cleaned up the other IE issues (cache-control & pragma
headers) but am stuck. Any ideas. Does this ring a bell?
Vincent
> -----Original Message-----
> From: opensource-admin at jcorporate.com
> [mailto:opensource-admin at jcorporate.com]On Behalf Of Michael Rimov
> Sent: Sunday, October 19, 2003 12:47 AM
> To: opensource at jcorporate.com
> Subject: Re: [Opensource] File downloads
>
>
> At 02:12 AM 10/17/2003, you wrote:
> >May be slightly OT, but maybe someone can give me some pointers...
> >I'm migrating from Expresso 5.0 to 5.3 (using RC5 at present).
> When testing
> >my file downloads from one site I hit a problem which seems to be IE6
> >specific (works on NS 7.1 and Opera). I click on the link to
> download the
> >file (these are held in my Sybase ASE12 database) and click the 'Open'
> >button on the resulting dialog. The appropriate application opens, but
> >complains that it can't find the file. It seems to be looking
> in subfolder
> >'Content.IE5\[random characters]\filename(1).doc' within my Internet temp
> >files folder. I can't see this folder anywhere (but a Google
> search seems
> >to suggest that this is nothing unusual!).
> >The strange thing is that another site I've converted to 5.3RC5
> (running on
> >the same server) doesn't have this problem. I still have a
> server running
> >the Expresso 5.0 version of the app and this works with IE6. I
> use Sybase
> >EAServer 4.2.2 for testing and production, but I've also tested both the
> >version 5.0 and 5.3 based apps in Tomcat 4.1.27 with IE6 and get the same
> >result - the 5.0 app works and the 5.3 one doesn't! If I choose
> to save the
> >file to disk this works OK, and I can then open it.
>
> Malc,
>
> Definitely Off topic! I've been fighting this one too. I originally
> thought it was a patch to IE that messed things up, since this
> appeared so
> suddenly... about the time I updated to Acrobat 6. In fact, if you want
> something REALLY weird, do download. The redirect link won't
> work, but the
> "click here if download does not commence" works great. I have confirmed
> that this is VERY IE related, and Mac Safari browser works well too.
>
> I'm glad to hear that 5.0 works though because that gives me something to
> work with. While playing with it, I found out that reading in the whole
> file and outputting it in one out.write() call helped, but 5.0 never even
> tried anything like that.
>
> I checked and the header setting code is _identical_ between 5.0 and
> 5.3. The JSP pages are identical too. Perhaps there's something
> going on
> at the controller level that I need to check [or possibly a side-affect
> interaction with Struts]
>
> I'll keep looking through it.
> -Mike
>
>
>
>
> _______________________________________________
> Opensource mailing list
> Opensource at jcorporate.com
> http://mail.jcorporate.com/mailman/listinfo/opensource
> Archives: http://mail.jcorporate.com/pipermail/opensource/
>
_______________________________________________
Opensource mailing list
Opensource at jcorporate.com
http://mailman.jcorporate.com/mailman/listinfo/opensource
**********************************************************************************************
The information contained in this message or any of its attachments may be confidential and is intended for the exclusive use of the addressee(s). Any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited without the express permission of the sender. The views expressed in this email are those of the individual and not necessarily those of Sony or Sony affiliated companies. Sony email is for business use only.
This email and any response may be monitored by Sony United Kingdom Limited.
(05)
**********************************************************************************************
More information about the Opensource
mailing list