[Zope] image from database field

Coi Giovanni coi@prometeo.it
Mon, 13 Sep 1999 09:18:25 +0200


Hi,

we want to build dynamic pages from a database (in our test lab is MS-
Access via ODBC) table with a BINARY field (say imgfld) filled with image 
in raw (binary not OLE!) (JPEG/GIF, ecc) and other fields. (As for example 
may be an "employees card list" where we need to show peoples portrait 
and a table row describe all the information for a person included his/her 
photo.)

The code we try was (suppose getTable1 as method to list all fileds in 
table) 

'listCards':

....
<!--#in getTable1 -->
   Name: <!--#var nameFld-->
   Address: <!--#var addressFld-->
  ....
  <img src="<!--#var imgFld -->">
....
<!--#/in>
....

but this is wrong because the 'src' attribute of the 'img' HTML tag want
the addres of the image not the image directly!
So we have the right image (the object imgFld) but we can't use it!

We need a way to get the "HTTP address" of the image object (that named 
'imgFld' in this name space) in current tuple returned from getTable1 
method when rendering the DTML tags in 'listCards'.

Any suggest?

Giovanni Coi

----------------------------------------------------------
Prometeo srl - The Software Experience
Coi Giovanni			
Voice : +39 (041)5701366        Via Giudecca 15
Fax   : +39 (041)5701005        30035 MIRANO (VE) - ITALY
e-mail: coi@prometeo.it         http://www.prometeo.it
----------------------------------------------------------