httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jos...@slive.ca>
Subject Re: content length header in ExtFilterDefine
Date Fri, 23 Aug 2002 13:53:40 GMT
Werner Schalk wrote:
> Hello,
> 
> well together with a friend I tried
> to write an output filter which converts
> text to pdf content. So I installed
> ghostscript and a2ps and wrote a small
> shell script which reads data from
> stdin, converts to pdf and prints
> this to stdout. It looks like this:
> /usr/local/a2ps-4.13/bin/a2ps -q -o - |
> /usr/local/ghostscript-7.05/bin/ps2pdfwr -
> 
> Then in httpd.conf I created this:
> ExtFilterDefine pdfwriter mode=output intype=text/html
> outtype=application/pdf PreservesContentLength

Wohhh!  What is "PreservesContentLength" doing in there.  This filter 
obviously changes the content length!

> And even later on:
> "...To resolve this behavior, contact the Web site author or
> administrator. Web site authors or administrators can resolve this
> problem if they configure their Web servers to send both a content-type
> header (MIME type) of "application/pdf" for .pdf files and an
> appropriate content-length header".
> 
> That why I thought of sending a content-length header to the client.

Ahh, OK, I didn't read that part carefully enough.  That is really bad 
behavior if it is true.  That would make it essentially impossible for 
cgi scripts to deliver PDF documents.  I'm guessing that this 
knowledgebase article is not perfectly accurate.

After fixing the PreservesContentLength issue, I'd start by looking at 
the actual HTTP headers that apache is sending with this file (using 
lynx -head -dump or a similar tool).

Depending on which version of Apache 2.0 you are running, you may also 
be hitting a bug with chunked encoding.  Make sure you are using 2.0.40.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message