-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dieter Maurer wrote:
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)".
That would defeat the "stream iterator" optimimzation, wouldn't it? Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFE5UQy+gerLs4ltQ4RAiglAJ4x7yj4Bbjv3kdZQTh+wGu04mrK4QCfdQ6u ZDkFQsOnTNLXZXSwK/TTyds= =AtDI -----END PGP SIGNATURE-----