makeUriFromPath(path)
Last updated September 23, 2004
Version: 1 | Requires: ColdFusion 5 | Library: FileSysLib
Description:
Accepts an aboluste path as input and returns a full URI as output. For example, "C:\Temp\Test.xml" returns "file:///C:/Temp/Test.xml".
Return Values:
Returns a URI.
Example:
Parameters:
| Name | Description | Required |
|---|---|---|
| path | Path to translate. | Yes |
Full UDF Source:
<cfscript>
/**
* Creates a URI from an absolute path.
*
* @param path Path to translate. (Required)
* @return Returns a URI.
* @author Samuel Neff (sam@blinex.com)
* @version 1, September 23, 2004
*/
function makeUriFromPath(path) {
var uri = path;
// make all backslashes into slashes
uri = replace(uri, "\", "/", "all");
if (left(uri,1) is "/") {
uri = right(uri, len(uri) - 1);
}
uri = "file:///" & uri;
return uri;
}
</cfscript>
Search CFLib.org
Latest Additions
Robby Lansaw added
getComponentProp...
3 day(s) ago
Dave Anderson added
iniToStruct
25 day(s) ago
Dave Anderson added
deDupeArray
25 day(s) ago
Richard added
dice
27 day(s) ago
Top Rated
backupDatabase
Rated 5.0, 22 time(s)
indentXml
Rated 5.0, 10 time(s)
generateSsccAsn
Rated 5.0, 4 time(s)
highlightAndCrop
Rated 5.0, 4 time(s)