[Zope] ZPublisher: How to set the mime header?

Eric Kidd eric.kidd@pobox.com
Tue, 16 Mar 1999 14:55:15 -0500


On Tue, Mar 16, 1999 at 07:44:18PM +0100, Oliver Thuns wrote:
> Hi!
> 
> I'm not using zope, but I'm using ZPublisher and ZServer. I'm coding a
> very simple counter module (with PIL). How could I set the mime header
> to image/gif and return an image? 

When using Zope to publish XML documents (using DTML Document objects) I
often write:

  <!--#call expr="REQUEST.setHeader('Content-Type', 'text/xml')-->

Some part of Zope tries to guess the Content-Type otherwise. A lot of this
code is directly shared between Zope and Z Publisher, so you might see
similar behavior.

Cheers,
Eric