House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

How to use ExpandPath

  << Previous Post |  RSS |  Tree View |  Sort Oldest First |  Subscribe to this Group Next >> 

How to use ExpandPath

What you can do is set them in the Application.cfm and assign them to a Mike Townend 06/11/2003 03:39 PM
----- Excess quoted text cut - see Original Post for more ----- Mike Mertsock 06/11/2003 03:27 PM
This helped much! Thanks! Angel Stewart 06/11/2003 11:28 AM
BTW you should add the contextroot to URLS too . webguy 06/11/2003 11:19 AM
If you want relative to the current template you can use Mike Townend 06/11/2003 11:14 AM
Yes, the fact that it's relative to the *base* template caused me untold Mike Mertsock 06/11/2003 11:05 AM
I would do it like this: Josh Trefethen 06/11/2003 02:53 AM
Expnadpath takes a relative path, so use "images/...". Pascal Peters 06/11/2003 02:41 AM
I find a good way to debug this is to display it then eyeball it: Matthew Walker 06/11/2003 01:39 AM
Hello All, Paige Chandler 06/11/2003 01:18 AM

06/11/2003 03:39 PM
Author: Mike Townend Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:24723#124417 What you can do is set them in the Application.cfm and assign them to a variable, then at any point you have a reference to the root... Ie Application.cfm <CFSET sRoot = GetDirectoryFromPath(GetCurrentTemplatePath())> Upload.cfm <CFFILE ACTION="Upload" FILEFIELD="foo" DIRECTORY="#sRoot#"> Etc ----- Excess quoted text cut - see Original Post for more ----- Oh i see. So ExpandPath's argument is a like a relative URL. But those other two functions are so freakin long to type! MM
06/11/2003 03:27 PM
Author: Mike Mertsock Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:24723#124415 ----- Excess quoted text cut - see Original Post for more ----- Oh i see. So ExpandPath's argument is a like a relative URL. But those other two functions are so freakin long to type! MM
06/11/2003 11:28 AM
Author: Angel Stewart Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:24723#124371 This helped much! Thanks! :) I didn't even know I needed help but I just made a little file upload routine I was writing a lot more efficient than hardcoding an Application variable called imagepath. -Gel If you want relative to the current template you can use GetCurrentTemplatePath() I usually use that with GetDirectoryFromPath() wrapped around it in my Application.cfm page for things like image upload paths ExpandPath() is for converting the URL script name into an absolute path HTH
06/11/2003 11:19 AM
Author: webguy Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:24723#124369 BTW you should add the contextroot to URLS too . Check out Seans blog for details, www.corfield.org If you want relative to the current template you can use GetCurrentTemplatePath() I usually use that with GetDirectoryFromPath() wrapped around it in my Application.cfm page for things like image upload paths ExpandPath() is for converting the URL script name into an absolute path HTH Yes, the fact that it's relative to the *base* template caused me untold frustration before I found that out. What is the strategy behind it working that way, instead of being relative from the current template? It does not make for easy-to-read code. Mike Mertsock Alfred University Web Team
06/11/2003 11:14 AM
Author: Mike Townend Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:24723#124368 If you want relative to the current template you can use GetCurrentTemplatePath() I usually use that with GetDirectoryFromPath() wrapped around it in my Application.cfm page for things like image upload paths ExpandPath() is for converting the URL script name into an absolute path HTH Yes, the fact that it's relative to the *base* template caused me untold frustration before I found that out. What is the strategy behind it working that way, instead of being relative from the current template? It does not make for easy-to-read code. Mike Mertsock Alfred University Web Team
06/11/2003 11:05 AM
Author: Mike Mertsock Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:24723#124367 Yes, the fact that it's relative to the *base* template caused me untold frustration before I found that out. What is the strategy behind it working that way, instead of being relative from the current template? It does not make for easy-to-read code. Mike Mertsock Alfred University Web Team
06/11/2003 02:53 AM
Author: Josh Trefethen Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:24723#124335 I would do it like this: <cfif fileExists( expandPath('./Images') & trim(session.client_ID) & trim(session.insured_ID) & '1.jpg')>   <!--- yada yada yada ---> </cfif> HTH, -- Josh Trefethen .:::::[ Exciteworks, Inc ]::[ http://exciteworks.com ]:::::. .::[ cf hosting on linux ]::[ consulting ]::[ expertise ]::. ----- Excess quoted text cut - see Original Post for more -----
06/11/2003 02:41 AM
Author: Pascal Peters Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:24723#124334 Expnadpath takes a relative path, so use "images/...". Also expandpath calculates a full path from the relative path starting from the base template (the one you requested in the URL). Otherwise this use of Expandpath is correct.   -----Oorspronkelijk bericht-----   Van: Paige Chandler [mailto:ceaser@erols.com]   Verzonden: wo 11/06/2003 7:16   Aan: CF-Talk   CC:   Onderwerp: How to use ExpandPath         Hello All,      Is the following the correct usage of ExpandPath?      <CFIF FileExists(ExpandPath("Images\#Trim(Session.Client_ID)##Trim(Session.Insured_ID)#1.jpg"))>    <INPUT Type="button" Value="View Certificate - page 1" Name="Search1" onClick="window.location='http:\CVS3WP14.CFM'">    <INPUT Type="button" Value="View Certificate - page 2" Name="Search1" onClick="window.location='http:\CVS3WP15.CFM'">   </CFIF>      The .jpg image does exist. I don't get a error but it doesn't display the buttons either. Help will be appreciated.  TIA.         Regards,      Paige   
06/11/2003 01:39 AM
Author: Matthew Walker Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:24723#124333 I find a good way to debug this is to display it then eyeball it: !<cfoutput>#ExpandPath("Images\#Trim(Session.Client_ID)##Trim(Session.Insure d_ID)#1.jpg")#</cfoutput>! ----- Excess quoted text cut - see Original Post for more -----
06/11/2003 01:18 AM
Author: Paige Chandler Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:24723#124331 Hello All, Is the following the correct usage of ExpandPath? <CFIF FileExists(ExpandPath("Images\#Trim(Session.Client_ID)##Trim(Session.Insured_ID)#1.jpg"))> <INPUT Type="button" Value="View Certificate - page 1" Name="Search1" onClick="window.location='http:\CVS3WP14.CFM'"> <INPUT Type="button" Value="View Certificate - page 2" Name="Search1" onClick="window.location='http:\CVS3WP15.CFM'"> </CFIF> The .jpg image does exist. I don't get a error but it doesn't display the buttons either. Help will be appreciated.  TIA. Regards, Paige
<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference