I'm using a image component and trying to loop through the uploaded file until 
the size requirement
is met.  However, I'm not sure about this error message. Is there anything 
wrong with my cfloop?
All the path variables are good and in a global_variables.cfm file in the Web 
root.

<cfloop condition = "FILE.fileSize GREATER THAN OR EQUAL TO 450000">

 <cfobject component="babystuff.component.image" name="myImage" />
 <cfset myImage.setKey("XXXXX-XXXXX-XXXXX-XXXXX-XXXXX") />
 <cfset 
myImage.readImage("#babysoftheweek_org_image_path##FORM.first_name#_#FORM.last_name#_#FORM.babys_name#.jpg")
 />
 <cfset 
myImage.writeImage("#babysoftheweek_resize_path##FORM.first_name#_#FORM.last_name#_#FORM.babys_name#_resized.jpg",
 "jpg", "100") />
 <cfset 
myImage.readImage("#babysoftheweek_resize_path##FORM.first_name#_#FORM.last_name#_#FORM.babys_name#_resized.jpg")
 />
 <cfset myImage.scalePercent(25, 25) />
<cfset 
myImage.writeImage("#babysoftheweek_resize_path##FORM.first_name#_#FORM.last_name#_#FORM.babys_name#_resized.jpg",
 "jpg", "100") />

 <cfdirectory action="list" directory="#babysoftheweek_resize_path#" 
filter="#FORM.first_name#_#FORM.last_name#_#FORM.babys_name#_resized.jpg" 
name="dirlist">

line 355 <CFSET file.FileSize = #dirlist#>  

</cfloop>

ERROR:
Complex object types cannot be converted to simple values. 
The expression has requested a variable or an intermediate expression result as 
a simple value, however, the result cannot be converted to a simple value. 
Simple values are strings, numbers, boolean values, and date/time values. 
Queries, arrays, and COM objects are examples of complex values. 
The most likely cause of the error is that you are trying to use a complex 
value as a simple one. For example, you might be trying to use a query variable 
in a <CFIF> tag. This was possible in ColdFusion 2.0 but creates an error in 
later versions. 
 
The error occurred in : line 1
Called from D:\Inetpub\wwwroot\Yobaby\BabyStuff\babies_of_the_week.cfm: line 355
Called from D:\Inetpub\wwwroot\Yobaby\BabyStuff\babies_of_the_week.cfm: line 310
Called from D:\Inetpub\wwwroot\Yobaby\BabyStuff\babies_of_the_week.cfm: line 1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264356
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to