...of course without the # at the end

<cfset temporaryfile = gettemporarydirabs() & "\" & theImage.getName() />




-----Original Message-----
From: "Phil Haeusler" <[email protected]>
To: [email protected]
Date: Mon, 01 Jun 2009 14:47:58 +1000
Subject: [cfaussie] Re: String concatenation - what's happening here?


Mike,
It looks like you're got CF trying to do an integer division with two 
strings.  Try 
 
<cfset temporaryfile = gettemporarydirabs() & "\" & theImage.getName()# />

instead.  That should work for you.
 
Phil


-----Original Message-----
From: Mike Kear <[email protected]>
To: cfaussie <[email protected]>
Date: Mon, 1 Jun 2009 14:38:33 +1000
Subject: [cfaussie] String concatenation - what's happening here?



i'm trying to concatenate two values - an absolute directory and a
filename into an absolute file reference for CFFILE to manipulate.
But i'm getting an error.  I've tried every combination and
permutation I can think of but still havent hit the correct one .  can
anyone see what i'm obviously too close to now to see?

The two values (which DO return strings  - i've checked) are :
#gettemporarydirabs()#   and  #theImage.getName()#

The error is:  "The value
E:\Sites\Customers\Customername\wwwroot\cms\images\userfiles\Temporary
cannot be converted to a number."     That value is what is returned
from the first function gettemporarydirabs() .

The line that causes the error is:
<cfset temporaryfile = tostring(#gettemporarydirabs()#\#theImage.getName()#) 
/>

I've also tried the following:

<cfset temporaryfile = "#gettemporarydirabs()#\#theImage.getName()#" />
<cfset temporaryfile = evaluate(#gettemporarydirabs()#\#theImage.getName()#) 
/>
<cfset temporaryfile = tostring(#gettemporarydirabs()# & "\" &
#theImage.getName()#) />

and a few other combinations, but all give the same result.

What am I missing here?   (I just KNOW its going to end up being one
of those 'slap the forehead' moments!)



-- 
Cheers
Mike Kear
Windsor, NSW, Australia
Adobe Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to