[Zope] http header question

Nathaniel Wingfield NWingfield at dixon-hughes.com
Wed Jan 19 16:11:17 EST 2005


OK, I found the solution and it's really wacky.  Apparently IE is
misreading the header, and if the word "attachment" shows up anywhere on
the Content-Disposition line, including in the file name itself, it will
spawn the dialog.

For example, the following will cause IE to launch the open/save/cancel
dialog every time:

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

While the following will launch the plugin every time:

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

-----Original Message-----
From: Phillip Hutchings [mailto:sitharus at gmail.com] 
Sent: Wednesday, January 19, 2005 3:50 PM
To: Nathaniel Wingfield
Cc: zope at zope.org
Subject: Re: [Zope] http header question

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

ID:[{20050119155530.24590.7625540730-66.208.180.43}]
_______________________________________________

CONFIDENTIALITY NOTICE

This e-mail is intended only for the addressee named above.
It contains information that is privileged, confidential
or otherwise protected from use and disclosure. If you are
not the intended recipient, you are hereby notified that
any review, disclosure, copying, or dissemination of this
transmission, or taking of any action in reliance on its
contents, or other use is strictly prohibited.

If you have received this transmission in error, please
reply to the sender listed above immediately and
permanently delete this message from your inbox.

Thank you for your cooperation.
ID:[{20050119161840.24590.7613879936-66.208.180.43}]


More information about the Zope mailing list