ya , this works with any binary data type. the trick is to make sure you are using text data type for string data and image data type for binary data.
search http://www.houseoffusion.com/cf_lists/ , michaels awesome list archive, for ... subject : images to the database anyone...? , which should also come up under posts by my email. i think i put all the relevant code up. gl, alex -----Original Message----- From: Ciliotta, Mario [mailto:[EMAIL PROTECTED]] Sent: Monday, October 07, 2002 7:51 PM To: CF-Talk Subject: RE: Saving an "Image" Datatype in CF5 Alexander, I was wondering if you could post the code that also does the image upload to SQL. I have tried but I still cannot get it work correctly. Also could the same upload be used for other types - such as word or excel documents? I would like to be able to store these documents in a database also. I would be using 4.5 currently but will be using 6.0 real soon - also SQL 7.0 but going to 2000. Thanks in advance. Mario -----Original Message----- From: Sicular, Alexander [mailto:[EMAIL PROTECTED]] Sent: Monday, October 07, 2002 6:03 PM To: CF-Talk Subject: RE: Saving an "Image" Datatype in CF5 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 Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm

