Ok, phew!  I decided to give the "store image in database" thing one
more try because I really hate working with paths and filesystems, and
finally figured it out.

Not really sure why but apparently SQLObject seems to continuously want
to convert binary to unicode.  So, I converted the image to base64:
image = Image(fileName=image.filename,
image=base64.encodestring(image.file.read()))

And then to display the image, I convert the image back:
def show_image(self, image_id):
     return base64.decodestring(Image.get(image_id).image)


Frank


--~--~---------~--~----~------------~-------~--~----~
 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