[Zope] Displaying BLOB's with Zope
Martin Gebert
Murphy@members.netsolution-net.de
Thu, 30 Jan 2003 02:12:33 +0100
Mark Evans schrieb:
>[...]
>
><img src=&dtml-blobtest;>
>
>[...]
>
>Created a python script called 'retrieveImage':
>
> photo = context.getImage()
> container.REQUEST.RESPONSE.setHeader('content-type', 'image/jpeg')
> return photo[0].image
>
>which calls the ZSQL method 'getImage':
>
> select image from blobtest
> where id='1'
>
>When I click on the 'test' tab for the python script, I get the following
>message:
>The image "http://foo.com/blobtest2/retrieveImage" cannot be displayed, because
>it contains errors.
>
>What am I missing here? Thanks in advance for the help.
>
>
The message basically means that the returned data isn't exactly what
was expected. Two things come to my mind:
1. What if you involve the retrieveImage script similar to the
description in the said HowTo (last line)?
2. Is the MIME type correct - is it really a JPEG?
I can't think of other possibilities right now; I'll have another look
tomorrow. Good night!
Martin