[Zope] Content-Disposition is driving me batty

Dieter Maurer dieter at handshake.de
Thu Aug 17 14:28:44 EDT 2006


Kirk Strauser wrote at 2006-8-16 17:28 -0500:
>I have a Python script that transmits a file to the user.  An excerpt:
>
>    if not skipctypeheader:
>        # Set the content type if one is defined for the file
>        ctype = file.getProperty('content_type', d=None)
>        if ctype:
>            RESPONSE.setHeader('Content-Type', ctype)
>
>    RESPONSE.setHeader('Content-Disposition', 'inline; filename=%s' % filename)
> ....
>< HTTP/1.1 200 OK
>< Date: Wed, 16 Aug 2006 22:26:11 GMT
>< Server: Zope/(Zope 2.9.3-, python 2.4.3, freebsd6) ZServer/1.1
>< Content-Length: 1742

Your PDF file appears to be small.

I am also surprised that in your earlier post you returned
the "File" object itself. I would rather expect
"str(fileObject.data)".



-- 
Dieter


More information about the Zope mailing list