ColdFusion Tutorial

Get the path where your application is installed on the server.

Sometimes it's useful to get the path to your application on the server.
Example: uploading and deleting images or deleting or checking if a file or template exists.

To get the application path use this code:
<cfoutput>#GetDirectoryFromPath(GetCurrentTemplatePath())#</cfoutput>

This will return:
N:\Inetpub\domain_name\ or N:\Inetpub\wwwroot\domain_name\
Where N is the drive on the server.

Testing this on a local web server returns:

On Windows: C:\Inetpub\wwwroot\scandicweb\

On Mac: /Library/WebServer/Documents/scandicweb/


GetDirectoryFromPath()
Extracts the directory with \ (backslash).


GetCurrentTemplatePath()
Returns the fully specified path of the template.


ColdFusion Tutorial test

Get the path where your application is installed on the server.

No test is available or implemented for this ColdFusion Tutorial.

User Comments: 1

 Thanks For this !!!

IT SOLVED MY MAJOR PROBLEM !!!

Add your comments

Your Name*:
Your Email:
Site URL:
Site Name:
Comemt Title*:
Your Comment*:
Key Phrase*:
6Ji
Your IP Address: 38.103.63.62
 

ScandicWeb is own by Scandic Systems LTD [UK] Company No. 5984000. All other trademarks and copyrights are the property of their respective holders.

[Home [Site Map [Privacy Statement [Site Feedback] [About ScandicWeb]


[ColdFusion [Flash [Search Engine Optimization [Graphics [Cascading Style Sheets (CSS) [JavaScript (JS) [Software]

Partner sites: ScandicSoft


Server time: 19. November 2008 Wednesday