Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Output an image from SQL 2000 column

Guest
Jul 07, 2010 Jul 07, 2010

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?

331
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jul 07, 2010 Jul 07, 2010
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources