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.
Advertisement
User Comments: 1
Thanks For this !!!
IT SOLVED MY MAJOR PROBLEM !!!


