[Zope] http header question

Phillip Hutchings sitharus at gmail.com
Wed Jan 19 15:49:40 EST 2005


On Wed, 19 Jan 2005 12:24:25 -0500, Nathaniel Wingfield
<NWingfield at dixon-hughes.com> wrote:
> 
> My application streams pdf files from disk (not zodb) to the user, and I've
> been writing the http header more or less manually.  I've had some strange
> problems with downloading – one particular third-party pdf plugin acts as if
> the file can not be found, and Internet Explorer arbitrarily, yet
> consistently pops the Open/Save/Cancel dialog for 1% of files, while
> launching a plugin for the other 99%. 
> 
> My header looks like this: 
> 
> HTTP/1.1 200 OK 
> Server: Zope/(Zope 2.7.3-0, python 2.3.4, linux2) ZServer/1.1 
> Date: Wed, 19 Jan 2005 17:08:30 GMT 
> Content-Length: 20004 
> Content-Type: application/pdf 
> Connection: close 
> Content-Disposition: filename="attachment.pdf" 
>
> Is there anything missing or malformed that could be causing trouble? 

I had this problem with PHP powered site. IE would always ask to save
and never display with the plugin. Even when the headers were
identical it wouldn't work, but everything other than IE worked. I 
just ended up serving directly with Apache.

A quick thing first, the Content-Disposition header should look like this:

Content-Disposition: inline; filename="attachment.pdf" 

to make IE display in the PDF plugin.

-- 
Phillip Hutchings
http://www.sitharus.com/
sitharus at gmail.com / sitharus at sitharus.com


More information about the Zope mailing list