On Wednesday 21 October 2009 11:04:38 Enrico wrote:
> > I honestly don't understand what your question is.
> >
> > Display the image on the same page as what?
>
> Sorry, maybe a new page but on the same tab. I can return a .png
> string from controller and it opens in a new tab but sending it to a
> template for a page in the same tab seems not possible.
>
> Yes, it is a bit strange what I do. I know in HTML <img
> src="filepath" /> wants a file but I don't want to write my generated
> image and then read it again. I tried to trick tg.url with
> NamedTemporaryFile but no good. Also, I think my NTF in memory is
> disappearing already when I return.

But you don't have to write anything into a file just to serve it. As you have 
learned, you can make a controller action that delivers a png, possibly based 
on parameters.

So all you need is

 - have a controller & template that contains

<img src="/path/to/my/action/serve_image?some=parameter"/>

 - the controllar action "serve_image" returns the image

When the browser reads the first, it will query the second. There is nothing 
in between.


That's HTTP/HTML 101.

Diez

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to