GetFileInfo() - get information about a file
GetFileInfo.cfm
<!DOCTYPE html">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>GetFileInfo function example: how to get information about a file</title>
</head>
<body>
<h2 style="color:Crimson">GetFileInfo Function Example: Normal</h2>
<cfset MyFile="C:\MyFolder\ReadMe.txt">
<cfoutput>
<cfif FileExists(MyFile)>
File: #MyFile#
<cfset FileInfo=GetFileInfo(MyFile)>
<cfdump var="#FileInfo#" label="FileInfo">
<br />
File Name: #FileInfo.Name#
<br />
File Path: #FileInfo.Path#
<br />
File Parent Directory: #FileInfo.Parent#
<br />
File Type: #FileInfo.Type#
<br />
File Size: #FileInfo.Size#
<br />
File LastModified: #FileInfo.LastModified#
<br />
File canRead: #FileInfo.canRead#
<br />
File isHidden: #FileInfo.isHidden#
<cfelse>
File not exists #MyFile#
</cfif>
</cfoutput>
</body>
</html>
- GetFileFromPath() - get a file name from an absolute path
- GetHTTPRequestData() - get HTTP request data (content, headers, method, protocol)
- SetLocale() - set the country language local for coldfusion processing and the page returned to the client
- GetMetricData() - get server performance metrics
- GetPageContext() - get the current coldfusion page context object
- GetTempFile() - create a temporary file in a directory
- WriteOutput() - append text to the page output stream