[Zope] External method and image

Michel Pottier Michel.Pottier at mfi.fr
Thu Oct 16 07:29:34 EDT 2003


Hi
  I have one external method which create jpeg file. I shall want to be
able to display these images in html page. I have tried  different
methods to do that, but either I get the image (only the image) or I get
the html page ( without image). How this can be done?
 In external method i have something like:

   (stin,stout) = os.popen2(commande)
    stin.close()
    resultat = stout.read()
    stout.close()
    REQUEST.RESPONSE.setHeader('Content-type','image/jpeg')
    REQUEST.RESPONSE.write(resultat)

and in dtml page i have try:
"
 <dtml-var standard_html_header>
 .....
 <dtml-var "creGraph(REQUEST)">
or <img src="<dtml-var "creGraph(REQUEST)">"> or ..

<dtml-var standard_html_footer> 
"
where creGraph is the external method

Thank you for your help
-- 
Michel Pottier
  METEO-FRANCE INTERNATIONAL
  Park Avenue  9 rue Michel Labrousse 31100 TOULOUSE
  Tel: +335 6143 2969 Fax: +335 6143 2969



More information about the Zope mailing list