List Info

Thread: how to display a piture out of the host dir?




how to display a piture out of the host dir?
user name
2006-02-23 07:40:03
hi, i refer to the wiki about Download handler. but i want
to display a
picture, not download. so i wrote "return
cherrypy.lib.cptools.serveFile(target_file_name,
name=kw['upload'].filename)" it could display a
picture, but only a
picture, like u open some address ended with image ext.
could i display
this picture hanging on the webpage?
thanks.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---

how to display a piture out of the host dir?
user name
2006-02-23 14:35:44
I may be misunderstanding your question but one way you can
serve
images both as a stanadlone url or inside an image tag is by
using a
static filter on an images folder. I have the following
lines in my
.conf file:

staticFilter.root = "/some/directory"
[/images]
staticFilter.on = True
staticFilter.dir = "images"

I think the keywords there may be changing from camelCase to
the
underscores convention but these lines work in both 2.1.1
and 2.2beta.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )