[Zope] question on howto readfile(img)

Andrew Milton akm at theinternet.com.au
Thu Jan 20 04:16:41 EST 2005


+-------[ Wombie Tomek ]----------------------
| i have what i hope is a fairly easy question that's been alluding me
| for a few hours.  i've been trying to rewrite a little script i wrote
| in php long ago.
| 
| i need to have a script, which returns an image once it decides it
| exists... the only thing i don't have worked out is how to do
| something like this:
| 
|    <dtml-var RESPONSE.setHeader('Content-Type','image/jpeg')>

<dtml-call "RESPONSE.setHeader('Content-Type','image/jpeg')">

|    readfile(img+?size=thumb);  <<----not sure how to do this, this is from php  
| 
| img being a path given through the url:     ie  ?img=somefolder/someimage.jpg

Is img a Zope Image type?
if soo...

<dtml-call "RESPONSE.write(img.index_html(REQUEST, RESPONSE)"> will do the
whole job for you... set the Content-Type header etc.


<obligatory type="warning">You Probably Shouldn't Do That In DTML</obligatory>


-- 
Andrew Milton
akm at theinternet.com.au


More information about the Zope mailing list