User Guide

128 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 131
cffile action = "copy" on page 133
cffile action = "delete" on page 135
cffile action = "move" on page 136
cffile action = "read" on page 138
cffile action = "readBinary" on page 140
cffile action = "rename" on page 141
cffile action = "upload" on page 143
cffile action = "write" on page 146
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 7: Added the result attribute, which allows you to specify an alternate variable
in which to receive result parameters. Used for
action = "upload" action.
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.