Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Blob Images

Status
Not open for further replies.

saraca

Programmer
Nov 8, 2004
4
0
0
US
I'm new to programming and also Coldfusion. Would someone be kind to show me the code to display Blob Images. I'm getting an error "ByteArray objects cannot be converted to strings". The code that I have is as follow:

<cfquery name="getImg" datasource="#Application.dsname#">
Select id, d_busdate,d_refno,imgData from #Session.db# where id='#Session.id#'

</cfquery>

<cfif #getImg.recordCount# gt 0>
<cfoutput><img src="#toBinary(getImg.imgData)#" width="650" height="300" border="1"></img></cfoutput>
 
There are two custom tags out there to help with this cfx_putimage and cfx_getimage. Do a google search for these.

But the way they would work: Create a ColdFusion page called "showImage.cfm" and pass it paramaters to uniquely identify an image. The CF page then sets the content type to, for example, "image/gif", then return the binary data.

<\img src="ShowImage.cfm?ImageID=3456">

NOTE: Courtesy of
[sub]
____________________________________
Just Imagine.
[sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top