Whatever message this page gives is out now! Go check it out!

GetTempDirectory

Last update:
May 18, 2026

Description

Gets the path of the directory that ColdFusion uses for temporary files. The directory depends on the account under which ColdFusion is running and other factors. Before using this function in an application, test to determine the directory it returns under your account.

Returns

The absolute pathname of a directory, including a trailing slash, as a string.

Category

Function syntax

GetTempDirectory()

See also

History

ColdFusion MX: Changed behavior: on Windows, this function now returns the temporary directory of the embedded Java application server. On other platforms, it returns the temporary directory of the operating system.

Example

<h3>GetTempDirectory Example</h3> 
 <p>The temporary directory for this ColdFusion server is 
 <cfoutput>#GetTempDirectory()#</cfoutput>.</p> 

<p>We have created a temporary file called: 

<cfoutput>#GetTempFile(GetTempDirectory(),"testFile")#</cfoutput></p>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page