Hi All,
I am trying to store the image file into sql database in a binary form. I can
sucessfully browse image, read it and display in the browser but unable to
convert it into binary.
This is wat I did
<cfset thisDir = expandPath(".")>
<cffile action="upload" fileField="image" destination="#thisDir#"
result="fileUpload"
nameconflict="overwrite">
<cfdump var="#thisDir#">
<cfimage action="read" source="#fileUpload.serverfile#"
name="myImage">
<cffile action="readBinary" file="#image#"
variable="FinalImage">
<br/>variable<cfdump var="#FinalImage#">
<!--- <cfset Image_Binary = "#toBinary(toBase64(FinalMergedDisclosure))#">
<cfdump var="#Image_Binary#"> --->
<cfquery name="Query4" datasource="Platform" result="result_1">
update table1 set Logo='#FinalImage#' where Name='John'
</cfquery>
but I am unable to save into the database and when I am trying to save it pops
up say:
ByteArray objects cannot be converted to strings.
I tried using toString etc..
Datatype for this column is varBinary(MAX).
Thanks,
Priya
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319869
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4