User Guide
110 Chapter 2: ColdFusion Tags
cffile
Description
Manages interactions with server files.
The following sections describe the actions of the
cffile tag:
• cffile action = "append" on page 113
• cffile action = "copy" on page 115
• cffile action = "delete" on page 116
• cffile action = "move" on page 117
• cffile action = "read" on page 119
• cffile action = "readBinary" on page 121
• cffile action = "rename" on page 122
• cffile action = "upload" on page 124
• cffile action = "write" on page 127
Note: To execute, this tag must be enabled in the ColdFusion Administrator. For more information,
see Configuring and Administering ColdFusion MX.
If your ColdFusion applications run on a server used by multiple customers, consider the security
of the files that could be uploaded or manipulated by
cffile. For more information, see
Configuring and Administering ColdFusion MX.
Category
File management tags
Syntax
The tag syntax depends on the action attribute value. See the following sections.
See also
cfdirectory
History
ColdFusion MX 6.1:
• Changed file path requirements: if you do not specify an absolute file path, the path is relative
to the ColdFusion temporary directory, which is returned by the
GetTempDirectory function.
• Changed behavior for action="read": if the file starts with a byte order mark (BOM)
ColdFusion uses it to determine the character encoding.
• Changed behavior for action="upload" nameConflict="MakeUnique" ColdFusion now
makes filenames unique by appending a incrementing number, 1 for the first file, 2 for the
second and so on, to the name. In ColdFusion MX filenames were made unique by appending
an additional "1" for each file, as in 1, 11, 111, and so on.
ColdFusion MX:
• Changed use of slashes in paths: you can use forward (/) or backward (\) slashes in paths on
both UNIX and Windows systems.
• Changed file hierarchy requirements: ColdFusion does not require that you put files and
directories that you manipulate with this tag below the root of the web server document
directory.