Some of my code...
<cfset path = "d:\temp\">
<cfset thisfilename = path & "id_" & getBinaryData.objectID & "-" &
getBinaryData.uuid & "." & getBinaryData.dataExtension >
<cfset tobin = tobinary(getBinaryData.base64String)>
<cfif fileexists(thisfilename)>
<cffile action="DELETE" file="#thisfilename#">
</cfif>
<cffile action="WRITE" file="#thisfilename#" output="#tobin#"
addnewline="No">
<cfset contenttype = "image/" & getBinaryData.dataExtension >
<cfcontent file="#thisfilename#" type="#contenttype#">
I also do the upload of theimage to sql via cf... However I store the
data in base64 (string) in an text field. That is why I do the
tobinary() function on the way out. I am still waiting for raw data
streaming like php in cf. in php you can do this without writing a temp
file.
Gl,
Alexander Sicular
Chief Technology Architect
Neurological Institute of New York
Columbia University
as867 [at] columbia {dot} edu
|-----Original Message-----
|From: Ben Koshy [mailto:[EMAIL PROTECTED]]
|Sent: Monday, October 07, 2002 2:24 PM
|To: CF-Talk
|Subject: Saving an "Image" Datatype in CF5
|
|
|I've got JPEG images being saved right in the SQL 2000
|Database as an "Image" Datatype... and I'm wondering how I get
|Cold Fusion to read this data and save it to a file? I tried
|a simple CFFILE action="write" to write out that field but
|that didn't seem to work. I'm using CF5 btw.
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.