On Mon, Mar 14, 2011 at 10:48 AM, Alan Holden <[email protected]> wrote:

>  Are you just trying to render the image on a web page?
> This is some old CF7 stuff I have:
>
> <cfsetting enablecfoutputonly="Yes">
> <cfsetting showdebugoutput="No">
> <!---  Pulls the Picture blob from the users table and returns the image to
> the browser. Call this script within the SRC attribute of an image tag, for
> example  --->
>
> <cfquery name="get_imageBlob" datasource="mydsn">
>    SELECT picture from table
> </cfquery>
> <cfheader name="content-disposition" value="Inline;filename=myImage.jpg">
> <cfcontent type="image/jpg">
> <cfoutput>#tostring(tobinary(get_imageBlob.picture))#</cfoutput>


Cool--another good approach that I'd guess works in OpenBD.

Based on some IMs Brandon and I had back and forth I wrote up a quick
tutorial/howto:
http://blog.mattwoodward.com/using-blob-images-in-open-bluedragon

I'm sure there are other approaches as well so feel free to offer up
different examples, thoughts, and opinions.

I do like ToDataUri() as opposed to <cfimage action="writetobrowser" ... />
personally since it's more generic and flexible.

-- 
Matthew Woodward
[email protected]
http://blog.mattwoodward.com
identi.ca / Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint,
etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html

-- 
official tag/function reference: http://openbd.org/manual/
 mailing list - http://groups.google.com/group/openbd?hl=en

Reply via email to