[Zope] Re: store an image within a session
Tue, 10 Jun 2003 08:19:08 -0700 (PDT)
Thank you very much for your answer Troy,
but I have still problems with your fourth step
(the img tag), because I'd like to display the image
from a DTML document not from a page template.
Obviously, something like:
doesn't dsiplay an image but the content of the jpeg
file, so do you know how to fix this problem?
--- Troy Farrell <firstname.lastname@example.org> wrote:
> This is an interesting request. Almost certainly,
> you do not want to do
> this, but if you do, you will want to
> 1) verify you have a session object
> (REQUEST['SESSION'] by default)
> 2) store your data there (REQUEST.SESSION.jpg_image
> 3) create a python script that returns the image:
> if REQUEST['SESSION'].has_key('jpg_image'):
> img = REQUEST.SESSION.jpg_image
> img = container.substitute_image.data
> return img
> 4) call the method from an img tag:
> <img alt="my image stored in a session"
> src="python_script_name" />
> Note that you'll have to calculate height and width
> on your own...
> That's a rough guess. It won't work without some
> messing around, but
> that's how I would approach such a challenge. I
> hope your server has a
> decent amount of RAM :)
> Oliver Bleutgen wrote:
> > Please do not mail me personally, mail to the zope
> list instead (I have
> > CC'd it), especially since I know nothing about
> > clebert_thibault wrote:
> >> Hi Sir!
> >> Do you know how to store the content of a jpeg
> file for instance
> >> within a session, then display this content of a
> jpeg file as an
> >> image?
> >> Thank you very much for your help,
> >> Tibo.
> > cheers,
> > oliver
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.