SOLVED! (was Re: [Zope] Content-Disposition is driving me batty)

Kirk Strauser kirk at daycos.com
Fri Aug 18 17:31:49 EDT 2006


On Thursday 17 August 2006 10:55 am, David H wrote:

> I had similar problems too.  This seems to work with IE:
>          theFile=open( self.pdfpath,'rb')
>          result = theFile.read()
>          ....
>          RESPONSE.setHeader('Content-Type','application/pdf')
>          RESPONSE.setHeader("Content-Disposition","filename=report.pdf")
>          RESPONSE.setHeader('Content-Length',len(result))
>          RESPONSE.write(result)

Sending the "Content-Length" header fixed the problem.  PDFs now appear 
inline and with their expected contents.  I haven't diffed the code between 
2.8 and 2.9, but I'm guessing that Zope used to send that header by default 
but no longer does.
-- 
Kirk Strauser
The Day Companies


More information about the Zope mailing list