[Zope-dev] Writing results directly back to browser

Hannu Krosing hannu@tm.ee
Thu, 11 Nov 1999 20:57:25 +0200


"David S. Harrison" wrote:
> 
> Maybe I am not understanding your point.  What is the type of 'imag'
> in your example? 

type is string

contents are what your external method generated (or what would be 
written to the file if the generated image were saved to disk)

> Is it a string?  If so, that means that the external
> image must write the image to disk and that location must be visible
> to the ZServer.

There is no /law/ that strings should be written to disk :)

You can just as well return them from functions.

> I would like to avoid it if possible.
> If 'imag' is some other type, how does ZServer know what to do with it?

Zope has no need to know what to do with it, it just returns it to the 
browser that requested the url.

You should set the Content-type: header though, so that the _browser_ 
would know that it is a png image

------------
Hannu