I have a page that lets the user upload an image to change the logo of the website. It works fine on ColdFusion MX7 but on earlier versions I get the following error;
Attribute validation error for tag CFQUERYPARAM.
The value of the attribute VALUE is invalid. The value cannot be converted to a string because it is not a simple value.Simple values are booleans, numbers, strings, and date-time values.
The Error Occurred in E:\Websites\Caracas\adm\upload_action.cfm: line 17
15 : <cfquery name="insImg" datasource="#Application.dsname#">
16 : UPDATE siteconfiguration
17 : SET logo = <cfqueryparam value="#MyBinary#" cfsqltype="cf_sql_blob">
18 : WHERE (coname = '#Application.coname#')
19 :
Here is the code that I'm using:
<cffile action="readbinary" file="#form.upload#" variable="logo" accept="image/*">
<cfquery name="insImg" datasource="#Application.dsname#">
UPDATE siteconfiguration
SET logo = <cfqueryparam value="#logo#" cfsqltype="cf_sql_blob">
WHERE (coname = '#Application.coname#')
</cfquery>
Attribute validation error for tag CFQUERYPARAM.
The value of the attribute VALUE is invalid. The value cannot be converted to a string because it is not a simple value.Simple values are booleans, numbers, strings, and date-time values.
The Error Occurred in E:\Websites\Caracas\adm\upload_action.cfm: line 17
15 : <cfquery name="insImg" datasource="#Application.dsname#">
16 : UPDATE siteconfiguration
17 : SET logo = <cfqueryparam value="#MyBinary#" cfsqltype="cf_sql_blob">
18 : WHERE (coname = '#Application.coname#')
19 :
Here is the code that I'm using:
<cffile action="readbinary" file="#form.upload#" variable="logo" accept="image/*">
<cfquery name="insImg" datasource="#Application.dsname#">
UPDATE siteconfiguration
SET logo = <cfqueryparam value="#logo#" cfsqltype="cf_sql_blob">
WHERE (coname = '#Application.coname#')
</cfquery>