CFLib.org – Common Function Library Project

ReturnWebRootTranslated()

Last updated May 09, 2003

author

David Whiterod

Version: 1 | Requires: CF5 | Library: UtilityLib

Description:
Returns the translated (file system) location of the web root directory. Relies on PATH_TRANSLATED and SCRIPT_NAME

Return Values:
Returns a string.

Example:

<cfset Variables.WebRootDir = ReturnWebRootTranslated()>

<cfoutput>#Variables.WebRootDir#</cfoutput>

Parameters:

No arguments.

Full UDF Source:

/**
 * Returns the translated (file system) location of the web root directory.
 * 
 * @return Returns a string. 
 * @author David Whiterod (whiterod.david@saugov.sa.gov.au) 
 * @version 1, May 9, 2003 
 */
function ReturnWebRootTranslated() {
  var tmpPath = Replace(CGI.SCRIPT_NAME, "/", "\", "ALL");
  return ReplaceNoCase(CGI.PATH_TRANSLATED, tmpPath, "", "ALL");
}

Search CFLib.org


Latest Additions

Raymond Camden added
QueryDeleteRows
November 04, 2017

Leigh added
nullPad
May 11, 2016

Raymond Camden added
stripHTML
May 10, 2016

Kevin Cotton added
date2ExcelDate
May 05, 2016

Raymond Camden added
CapFirst
April 25, 2016

Created by Raymond Camden / Design by Justin Johnson