Re: FileExists using variable - not working

2010-04-08 Thread Dorioo

To troubleshoot, one, the pounds are not needed so I'd take those out.
Two, in cfelse, what is the value of:

cfoutput#variables.ImageSource#cfoutput do something else

In other words, what is the variable's value as soon as you hit cfelse.

- Gabriel

On Thu, Apr 8, 2010 at 1:03 PM, Fred Grainger i...@fredgrainger.com wrote:

 Ok - I'm about to pull my hair out.

 I am using fileexists() function to determine whether a image file exists on 
 the server. When I type in the path it works fine, but when I use a variable 
 it always returns false.

 My code is like this:

 cfset variables.ImageSource = C:\somedirectoy\somefile.txt

 cfif FileExists(#variables.ImageSource#)
 do something
 cfelse
 do something else
 /cfif

 The variable works everywhere else in the code. I am outputting it to the 
 browser and have double triple checked to make sure the variable value is 
 correct.

 I've been working on this a day and a half and cannot get it to work.

 HELP!

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332773
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread William Seiter

try
cfif FileExists('#variables.ImageSource#')
or
cfif FileExists(variables.ImageSource)


--
William E. Seiter


On Apr 8, 2010, Fred Grainger i...@fredgrainger.com wrote: 


Ok - I'm about to pull my hair out.

I am using fileexists() function to determine whether a image file exists on 
the server. When I type in the path it works fine, but when I use a variable it 
always returns false.

My code is like this:

cfset variables.ImageSource = C:\somedirectoy\somefile.txt

cfif FileExists(#variables.ImageSource#)
do something
cfelse
do something else
/cfif

The variable works everywhere else in the code. I am outputting it to the 
browser and have double triple checked to make sure the variable value is 
correct.

I've been working on this a day and a half and cannot get it to work.

HELP! 



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332774
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Cutter (ColdFusion)

We use this all over, though you don't need the hash marks.

Steve Cutter Blades
Adobe Community Professional - ColdFusion
Adobe Certified Professional
Advanced Macromedia ColdFusion MX 7 Developer

Co-Author of Learning Ext JS
http://www.packtpub.com/learning-ext-js/book
_
http://blog.cutterscrossing.com



Fred Grainger wrote:
 Ok - I'm about to pull my hair out.

 I am using fileexists() function to determine whether a image file exists on 
 the server. When I type in the path it works fine, but when I use a variable 
 it always returns false.

 My code is like this:

 cfset variables.ImageSource = C:\somedirectoy\somefile.txt

 cfif FileExists(#variables.ImageSource#)
 do something
 cfelse
 do something else
 /cfif

 The variable works everywhere else in the code. I am outputting it to the 
 browser and have double triple checked to make sure the variable value is 
 correct.

 I've been working on this a day and a half and cannot get it to work.

 HELP! 

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332775
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Dave Watts

 I am using fileexists() function to determine whether a image file exists on 
 the server. When I type in the path it works fine, but
 when I use a variable it always returns false.

 My code is like this:

 cfset variables.ImageSource = C:\somedirectoy\somefile.txt

 cfif FileExists(#variables.ImageSource#)
 do something
 cfelse
 do something else
 /cfif

 The variable works everywhere else in the code. I am outputting it to the 
 browser and have double triple checked to make sure the
 variable value is correct.

The fileExists function expects a string literal. Wrap
#variables.imageSource# with double quotes to treat the value as a
string literal.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332776
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Fred Grainger

Tried:
cfif FileExists(#variables.ImageSource#)
cfif FileExists('#variables.ImageSource#')
cfif FileExists(#variables.ImageSource#)
cfif FileExists(variables.ImageSource)

None of which works. 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332777
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Fred Grainger

The value of the variable is:
C:\somepath\filename.png 
Which is correct. 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332778
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Ian Skinner

On 4/8/2010 10:26 AM, Fred Grainger wrote:
 Tried:
 cfif FileExists(#variables.ImageSource#)
 cfif FileExists('#variables.ImageSource#')
 cfif FileExists(#variables.ImageSource#)
 cfif FileExists(variables.ImageSource)

 None of which works.


Just a shot in the dark, cfif FileExists(trim(variables.ImageSource))

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332779
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Dave Watts

 The value of the variable is:
 C:\somepath\filename.png
 Which is correct.

When I was testing this a few minutes ago, I noticed that when I made
changes to the fileExists function, the file wasn't being recompiled -
I had to make some other change (any other change) and save the file
again.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332780
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Fred Grainger

How can you tell when a template is recompiled?

I made some changes and tried again.  Still no dice?

I'm outputting the variable and it looks correct, unless there is a control 
character or something in the string that I cannot see.  I am thinking this 
might be the issue.  The file name was imported in SQL Server from excel.

 The value of the variable is:
 C:\somepath\filename.png
 Which is correct.

When I was testing this a few minutes ago, I noticed that when I made
changes to the fileExists function, the file wasn't being recompiled -
I had to make some other change (any other change) and save the file
again.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite. 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332781
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Fred Grainger

It is the correct path and file name.

C:\somepath\filename.png

I am thinking that there may be a control character of something that I cannot 
see.  I am reading the filename.png from SQL Server.


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332782
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Dave Watts

 How can you tell when a template is recompiled?

You can attempt to identify the compiled file in the WEB-INF/cfclasses
subdirectory, and look at the timestamp.

 I made some changes and tried again.  Still no dice?

 I'm outputting the variable and it looks correct, unless there is a control 
 character or something in the string that I cannot see.  I
 am thinking this might be the issue.  The file name was imported in SQL 
 Server from excel.

That could be the issue.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsi

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332783
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Fred Grainger

Tried:
cfif FileExists(#variables.ImageSource#) 
cfif FileExists('#variables.ImageSource#')
cfif FileExists(#variables.ImageSource#)
cfif FileExists(variables.ImageSource)
cfif FileExists(trim(variables.ImageSource))
None of which works.


 The fileExists function expects a string literal. Wrap
 #variables.imageSource# with double quotes to treat the value as a
 string literal.
 
 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 http://training.figleaf.com/
 
 Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
 GSA Schedule, and provides the highest caliber vendor-authorized
 instruction at our training centers, online, or onsite.


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332784
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Fred Grainger

Took the hash marks out.  Put quotes, trimmed the variable, checked the length 
of the file name to make sure there weren't any control characters or anything. 
 My code is very straight forward.  

A day and a half later, still no dice.  This is the first time I've used this 
function.  We just upgraded to CF9 a few weeks ago, but it is up to date.

This makes no sense whatsoever.  When I type the file path into the FileExists 
function it works fine.  Will not work with a variable.  Period. 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332785
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Dave Watts

 Took the hash marks out.  Put quotes, trimmed the variable, checked the 
 length of the file name to make sure there weren't any
 control characters or anything.  My code is very straight forward.

 A day and a half later, still no dice.  This is the first time I've used this 
 function.  We just upgraded to CF9 a few weeks ago, but it
 is up to date.

 This makes no sense whatsoever.  When I type the file path into the 
 FileExists function it works fine.  Will not work with a
 variable.  Period.

I can tell you that it's working on my laptop running CF 9 on 64-bit
Windows 7 just fine.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332786
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Re: FileExists using variable - not working

2010-04-08 Thread William Seiter

try:
cfset variables.blah = '[filelocation filename you know exists]'
cfif fileExists(variables.blah)
Success!!
cfelse
Failed!!
/cfif
cfdump var=#variables.blah#


--
William E. Seiter


On Apr 8, 2010, Fred Grainger i...@fredgrainger.com wrote: 


Took the hash marks out.  Put quotes, trimmed the variable, checked the length 
of the file name to make sure there weren't any control characters or anything. 
 My code is very straight forward.  

A day and a half later, still no dice.  This is the first time I've used this 
function.  We just upgraded to CF9 a few weeks ago, but it is up to date.

This makes no sense whatsoever.  When I type the file path into the FileExists 
function it works fine.  Will not work with a variable.  Period. 



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332787
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Fred Grainger

Yep - If it type in a literal into the variable it is working.  When I build 
the file path from the database fields it will not work.  When I manually cut 
and paste the cfoutput of the variable I build with the database fileds into 
the fileexists function it finds it.  It does not like something about the 
variable that is created with the query value.  

I'm sure it is something simple.  I'm about to throw in the towel though.  I 
cannot get this to work.
 
 I can tell you that it's working on my laptop running CF 9 on 64-bit
 Windows 7 just fine.
 
 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 http://training.figleaf.com/
 
 Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
 GSA Schedule, and provides the highest caliber vendor-authorized
 instruction at our training centers, online, or 


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332790
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Wil Genovese

I was digging into Adobe's docs to see if something change.  1. Their examples 
are terrible.  It's amazing anyone learns anything from those. 2. Nothing noted 
about changed behavior.

So I took their example and fixed it so it would work.  Try this.

h3FileExists Example/h3

cfset thisPath = getCurrentTemplatePath()
cfset thisDirectory = GetDirectoryFromPath(thisPath)
cfoutputThe current directory is: #thisDirectory#/cfoutput

cfset yourFile = getFileFromPath(thispath)
cfif FileExists(thispath)
pThe filename is: cfoutput#yourfile#/cfoutput/p
cfelse
pThe file can not be found/p
/cfif




Wil Genovese

One man with courage makes a majority.
-Andrew Jackson

A fine is a tax for doing wrong. A tax is a fine for doing well. 

On Apr 8, 2010, at 1:30 PM, William Seiter wrote:

 
 try:
 cfset variables.blah = '[filelocation filename you know exists]'
 cfif fileExists(variables.blah)
 Success!!
 cfelse
 Failed!!
 /cfif
 cfdump var=#variables.blah#
 
 
 --
 William E. Seiter
 
 
 On Apr 8, 2010, Fred Grainger i...@fredgrainger.com wrote: 
 
 
 Took the hash marks out.  Put quotes, trimmed the variable, checked the 
 length of the file name to make sure there weren't any control characters or 
 anything.  My code is very straight forward.  
 
 A day and a half later, still no dice.  This is the first time I've used this 
 function.  We just upgraded to CF9 a few weeks ago, but it is up to date.
 
 This makes no sense whatsoever.  When I type the file path into the 
 FileExists function it works fine.  Will not work with a variable.  Period. 
 
 
 
 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332791
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Roger Austin

 Fred Grainger i...@fredgrainger.com wrote: 
 
 Yep - If it type in a literal into the variable it is working.  When I build 
 the file path from the database fields it will not work.  When I manually cut 
 and paste the cfoutput of the variable I build with the database fileds into 
 the fileexists function it finds it.  It does not like something about the 
 variable that is created with the query value.  

Have you tried checking the length of the string? Sometimes, you get a 
CR/LF at the end with Excel.

--
http://www.linkedin.com/pub/roger-austin/8/a4/60
http://twitter.com/RogerTheGeek
http://www.misshunt.com/ Home of the Clean/Dirty Magnet
http://www.ncdevcon.com/ TACFUG 2010 Conference in North Carolina


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332792
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Wil Genovese

You said that When I build the file path from the database fields it will not 
work. .  Lets see that code.  Something may not be what it seems to be.



Wil Genovese

One man with courage makes a majority.
-Andrew Jackson

A fine is a tax for doing wrong. A tax is a fine for doing well. 

On Apr 8, 2010, at 1:44 PM, Fred Grainger wrote:

 When I build the file path from the database fields it will not work. 


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332793
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Fred Grainger

 Have you tried checking the length of the string? Sometimes, you get a 
 
 CR/LF at the end with Excel.
 
 --
 http://www.linkedin.com/pub/roger-austin/8/a4/60
 http://twitter.com/RogerTheGeek
 http://www.misshunt.com/ Home of the Clean/Dirty Magnet
 http://www.ncdevcon.com/ TACFUG 2010 Conference in North Carolina

Yes - checked the length of the variable and it is correct.  I was thinking the 
same thing... 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332794
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Fred Grainger

 You said that When I build the file path from the database fields it 
 will not work. .  Lets see that code.  Something may not be what it 
 seems to be.
 
 
cfset variables.ImageSource = 
'C:\Inetpub\wwwroot\Interspire\images_originals\cfoutput#trim(catalog.sku)#/cfoutput.png'

The value is:
C:\Inetpub\wwwroot\Interspire\images_originals\707-2298005-001.png

The length of the variable is 15.

The file exists - I have the image output next to the path and file name... 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332795
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Wil Genovese

Well thats the problem alright.  Your putting CFOUTPUT in the cfset tag. It's 
getting used as a literal.

This is the better way to do this

cfset variables.ImageSource = 
'C:\Inetpub\wwwroot\Interspire\images_originals\#trim(catalog.sku)#.png'

Alternately you could do this:
cfset variables.ImageSource = 
'C:\Inetpub\wwwroot\Interspire\images_originals\'   trim(catalog.sku)  '.png'

What you were doing produced an output that looked like this:

C:\Inetpub\wwwroot\Interspire\images_originals\cfoutput394803/cfoutput.png
Assuming the catalog.sku = 394803




Wil Genovese

One man with courage makes a majority.
-Andrew Jackson

A fine is a tax for doing wrong. A tax is a fine for doing well. 

On Apr 8, 2010, at 1:58 PM, Fred Grainger wrote:

 
 You said that When I build the file path from the database fields it 
 will not work. .  Lets see that code.  Something may not be what it 
 seems to be.
 
 
 cfset variables.ImageSource = 
 'C:\Inetpub\wwwroot\Interspire\images_originals\cfoutput#trim(catalog.sku)#/cfoutput.png'
 
 The value is:
 C:\Inetpub\wwwroot\Interspire\images_originals\707-2298005-001.png
 
 The length of the variable is 15.
 
 The file exists - I have the image output next to the path and file name... 
 
 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332797
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Ian Skinner

On 4/8/2010 11:58 AM, Fred Grainger wrote:

 You said that When I build the file path from the database fields it
 will not work. .  Lets see that code.  Something may not be what it
 seems to be.


  
 cfset variables.ImageSource = 
 'C:\Inetpub\wwwroot\Interspire\images_originals\cfoutput#trim(catalog.sku)#/cfoutput.png'


cfset variables.ImageSource = 
'C:\Inetpub\wwwroot\Interspire\images_originals\#trim(catalog.sku)#.png'

 The value is:
 C:\Inetpub\wwwroot\Interspire\images_originals\707-2298005-001.png


I bet if you view source you will see that the value is really :

C:\Inetpub\wwwroot\Interspire\images_originals\cfoutput707-2298005-001/cfoutput.png

But the browser is hiding the tags it does not understand.




~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332798
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Fred Grainger

Thank you so much.  What a newbie error.  I had tried it without the cfoutput 
and was at the point of frustration I was coding recklessly.

That fixed it!

 Well thats the problem alright.  Your putting CFOUTPUT in the cfset 
 tag. It's getting used as a literal.
 
 This is the better way to do this
 
 cfset variables.ImageSource = 
 'C:\Inetpub\wwwroot\Interspire\images_originals\#trim(catalog.sku)#.
 png'
 
 Alternately you could do this:
 cfset variables.ImageSource = 
 'C:\Inetpub\wwwroot\Interspire\images_originals\'   trim(catalog.sku) 
  '.png'
 
 What you were doing produced an output that looked like this:
 
C:\I netpub\wwwroot\Interspire\images_originals\cfoutput394803/cfoutput.
 png
 Assuming the catalog.sku = 394803
 
 
 
 
 Wil Genovese
 
 One man with courage makes a majority.
 -Andrew Jackson
 
 A fine is a tax for doing wrong. A tax is a fine for doing well. 
 
 On Apr 8, 2010, at 1:58 PM, Fred Grainger wrote:
 
  
  You said that When I build the file path from the database fields 
 it 
  will not work. .  Lets see that code.  Something may not be what 
 it 
  seems to be.
  
  
  cfset variables.ImageSource = 
' C:\Inetpub\wwwroot\Interspire\images_originals\cfoutput#trim(catalog.
 sku)#/cfoutput.png'
  
  The value is:
  C:\Inetpub\wwwroot\Interspire\images_originals\707-2298005-001.png
  
  The length of the variable is 15.
  
  The file exists - I have the image output next to the path and file 
 name... 
  
  


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332801
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: FileExists using variable - not working

2010-04-08 Thread Fred Grainger

On 4/8/2010 11:58 AM, Fred Grainger wrote:

cfset variables.ImageSource = 
'C:\Inetpub\wwwroot\Interspire\images_originals\#trim(catalog.sku)#.png'

 The value is:
 C:\Inetpub\wwwroot\Interspire\images_originals\707-2298005-001.png


I bet if you view source you will see that the value is really :

C:\Inetpub\wwwroot\Interspire\images_originals\cfoutput707-2298005-001/cfoutput.png

But the browser is hiding the tags it does not understand.

I looked at the source and the tags were not there, but when I took the out, it 
worked.  Thanks! 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332802
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm