Skip to main content
July 7, 2010
Question

Output an image from SQL 2000 column

  • July 7, 2010
  • 1 reply
  • 357 views

When i have built database in the past, i usually just store the name of the image in a text field and output the url with this name. I have found this work brilliantly.

My problem, i am using an old SQL 2000 database and signatures are being uploaded into a column with "image" type.

I need to output the images but not having much luck.

/********************** Code ***********************/

<cfsetting enablecfoutputonly="yes">

<cfquery name="GetImage" datasource="Podviewer">

SELECT     printed_name

FROM         PODVIEWER_TRANS

WHERE     (pro_code = 'SS') AND (con_num = '90053622') AND (pre_num = '1') AND (Dac = '40263') AND (sched_start_date = '6/1/2010')

</cfquery>

<!--- Output binary object to JPEG format for viewing. --->

<cffile action="write" file = "C:\imagestest\somewhereB.jpg" output = "#getImage.printed_name#">

/********************** End *************************/

When i view the image in the directory, it is just blank.

Any ideas?

    This topic has been closed for replies.

    1 reply

    ilssac
    Inspiring
    July 7, 2010

    I think you want to use the <cfimage....> tag for this.

    At least that is what I read in the first paragraph of this page of documentation I found with a search of Google.

    Creating images from BLOB data

    http://livedocs.adobe.com/coldfusion/8/htmldocs/Images_05.html