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

cffile action = "delete"

Last update:
May 18, 2026

Description

Deletes a file on the server.

Syntax

<cffile 
action = "delete" 
file = "full pathname">

Note: You can specify this tag's attributes in an attributeCollection attribute whose value is a structure. Specify the structure name in the attributeCollection attribute and use the tag's attribute names as structure keys.

See also

Attributes

Attribute
Req/Opt
Default
Description
action
Required
Type of file manipulation that the tag performs.
file
Required
Pathname of the file to delete. If not an absolute path (starting with a drive letter and a colon, or a forward or backward slash), it is relative to the ColdFusion temporary directory, which is returned by the GetTempDirectory function.

Example

The following example deletes the specified file:
<cffile action = "delete" 
file = "c:\files\upload\#Variables.DeleteFileName#">

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