External method and image
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
Michel Pottier wrote:
and in dtml page i have try: " <dtml-var standard_html_header> ..... <dtml-var "creGraph(REQUEST)"> or <img src="<dtml-var "creGraph(REQUEST)">"> or ..
try with <img src="creGraph"> HTH -- //// (@ @) ---------------------------oOO----(_)----OOo------------------------ Los pecados de los tres mundos desapareceran conmigo. Alexis Roda - Universitat Rovira i Virgili - Reus, Tarragona (Spain) --------------------------------------------------------------------
Michel Pottier wrote:
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
What you do: <img src="YouIncludeTheBinaryDataOfTheImageBetweenTheQuotes"> Correct is: <img src="PathToTheImageSoTheBrowserCanFetchItViaHTTP"> Hope this helps. Cheers, Maik
participants (3)
-
Alexis Roda -
Maik Jablonski -
Michel Pottier