You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Christoph Meier <ch...@webmover.ch> on 2002/03/20 11:41:41 UTC
Re: Serving PDF's: set the content-length in the HTTP-Response-Header
I think Phil is right about the bug in IE+Acrobat plug-in.
IE+Acrobat plug-in stop dowloading the stream after a certain amount of
bytes is down.
The problem should be fixed if you can set the content-length in the
HTTP-Response-Header, to tell IE+Acrobat plug-in about the size of the
Response-Stream.
At least this worked when i was trying to serve PDFs from another
application-server. I never tried serving PDFs with a
Java-based-App-Server, yet, therefore i didn't tried that within cocoon, ...
but i'm quite sure it will work.
the point is, i have no idea where to set this
HTTP-Response-Header-Property within cocoon.
let me know it, if it worked.
greez,
chm
> Phil Blake wrote:
>
>> Hi all,
>>
>> I want to serve PDF's - nothing special, no generation or
>> transformation - simply returning an existing pdf from a request.
>>
>> So... I added the following to my sitemap:
>>
>> <map:match pattern="**pdf/**.pdf">
>> <map:read src="resources/pdf/{2}.pdf" mime-type="application/pdf"/>
>> </map:match>
>>
>> I have a pile of PDF's in the /resources/pdf directory, however, none
>> of them are successfully served.
>>
>> Only a small amount of the original PDF is transfered - ie. it's a
>> 200K doc but less than 50K ends up at the browser and as far as
>> acrobat is concerned - it's damaged.
>>
>> What silly thing have I missed?
>>
>> Thanks in advance,
>>
>> Phil
>
>
> Not sure that it helps. But I have heard about a nasty bug in
> IE+Acrobat plug-in.
> If you use them, you should try a different browser to check the
> serving of the PDF.
>
> (I think the bug is about streaming PDF, that are handled incorrectly
> by IE)
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Serving PDF's: set the content-length in the HTTP-Response-Header
Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Christoph Meier wrote:
> I think Phil is right about the bug in IE+Acrobat plug-in.
> IE+Acrobat plug-in stop dowloading the stream after a certain amount
> of bytes is down.
>
> The problem should be fixed if you can set the content-length in the
> HTTP-Response-Header, to tell IE+Acrobat plug-in about the size of the
> Response-Stream.
> At least this worked when i was trying to serve PDFs from another
> application-server. I never tried serving PDFs with a
> Java-based-App-Server, yet, therefore i didn't tried that within
> cocoon, ...
> but i'm quite sure it will work.
>
> the point is, i have no idea where to set this
> HTTP-Response-Header-Property within cocoon.
> let me know it, if it worked.
<snip/>
The only solution for now is to extend the ResourceReader to make
shouldSetContentLength() return true. However, this means that Cocoon
will buffer internally the whole file before sending it down to the
browser, which may not be what you want for large files.
A better long term solution would be for a Reader to be able to give the
content-length (will add this to the todo list).
Note also that FOPSerializer returns true, meaning this problem doesn't
exist for dynamically-generated PDF.
Sylvain
--
Sylvain Wallez
Anyware Technologies Apache Cocoon
http://www.anyware-tech.com mailto:sylvain@apache.org
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>