Forum OpenACS Q&A: blob confusion
I am having some trouble figuring out how to retrieve a jpeg file stored using Don Baccus' lob hack.
- RedHat 6.2
- PostgreSQL 7.0.1
- OpenACS 3.2.4
Apparently, I am storing jpeg files in the database without any difficulty. Here is how I am trying to retrieve them:
This doesn't completely make sense to me, because the src tag should be a file, but I can't think what else to do. In any case, the log shows no errors, but this returns an empty variable.set db [ns_db gethandle] set lob [database_to_tcl_string $db "select lob from public_space_images where public_space_image_id=$public_space_image_id"] set image [ns_pg blob_write $db $lob] set image_string (img src=$image) # the img tag has angle brackets in the real thing -- Netscape doesn't # seem to handle preformatted text very well ns_return 200 text/html $image_string
Thanks, as always, for your help.