Forum OpenACS Development: Re: Displaying database BLOB image how?

Collapse
Posted by Gaven Eogan on
thanks for your reply.

Interesting. I didn't know that BLOBS were returned as base64 from the database.

Actually I was just trying to find what OpenACS functions could be used to actually return the BLOB data back to the IMG inside the page. I did see that people use small includes inside the image tag and the include program does a "cr_write_content" call but that only works when the image is stored in the conent resository.

I was just trying to find the equivalent function to return a BLOB back to the browser in an include.

But I gave up and went back to using the content repository and its functions after figuring out how to make or use my data as an object (that was why i couldn't use it before)

Collapse
Posted by Benjamin Brink on
I haven't used blobs myself.

I'm not sure if an image blob is in base64. In email, images can be base64.

There's a db command in api called db_blob_get: https://openacs.org/api-doc/proc-view?proc=db_blob_get&source_p=1 It states it's 'PostgreSQL only.' but the source shows code for oracle as well. Maybe it's buggy.

Maybe this thread has something useful: https://openacs.org/forums/message-view?message_id=88888