FileType(path)
Last updated July 24, 2001
Version: 1 | Requires: ColdFusion 5 | Library: FileSysLib
Description:
Returns a string corresponding to the type of file specified. Because this function uses COM, it is only supported in the Windows version of ColdFusion.
Return Values:
Returns a string.
Example:
<CFOUTPUT>
The file #TheFile# is a(n) <I>#FileType(TheFile)#</I>.
</CFOUTPUT>
Parameters:
| Name | Description | Required |
|---|---|---|
| path | Absolute or relative path to the specified file. | Yes |
Full UDF Source:
<cfscript>
/**
* Returns a string corresponding to the type of file specified. (Windows only)
*
* @param path Absolute or relative path to the specified file.
* @return Returns a string.
* @author Rob Brooks-Bilson (rbils@amkor.com)
* @version 1.0, July 24, 2001
*/
function FileType(path)
{
Var fso = CreateObject("COM", "Scripting.FileSystemObject");
Var theFile = fso.GetFile(path);
Return theFile.Type;
}
</cfscript>
Search CFLib.org
Latest Additions
Tony Felice added
writeStateSelect
14 hour(s) ago
Tony Felice added
varNameToText
15 hour(s) ago
Larry C. Lyons added
splitMX
15 hour(s) ago
Tony Felice added
listIsItemSimila...
15 hour(s) ago
Tony Felice added
listCountItemSim...
15 hour(s) ago
Top Rated
ListCompare
Rated 5.0, 6 time(s)
QueryStringChang...
Rated 5.0, 4 time(s)
FormatSSN
Rated 5.0, 2 time(s)
DollarAsString
Rated 5.0, 2 time(s)
CapFirstTitle
Rated 5.0, 2 time(s)