Adobe ColdFusion 8

Creating an image from a binary object

You can use the cffile tag to write an image file to ColdFusion variable. Then, you can pass the variable to the ImageNew function to create a ColdFusion image from the binary object, as the following example shows:

<!--- Use the cffile tag to read an image file, convert it to binary format, and write the
    result to a variable. --->
<cffile action = "readBinary" file = "jeff05.jpg" variable = "aBinaryObj">
<!--- Use the ImageNew function to create a ColdFusion image from the variable. --->
<cfset myImage=ImageNew(aBinaryObj)>