User Guide
52 CFML Language Reference
Example The following example moves the keymemo.doc file from the c:\files\upload\
directory to the
c:\files\memo\ directory on Windows:
<CFFILE ACTION="Move"
SOURCE="c:\files\upload\keymemo.doc"
DESTINATION="c:\files\memo\">
Note On Windows, you must include the backward slash (\) after the
destination directory name if you do not specify a file name. In this
example, the specified destination directory is "memo. "
CFFILE ACTION="Rename"
Use CFFILE with the Rename action to rename a file that already exists on the server.
Syntax <CFFILE ACTION="Rename"
SOURCE="full_path_name"
DESTINATION="full_path_name"
ATTRIBUTES="file_attributes">
SOURCE
Required. The full path name of the file to rename.
DESTINATION
Required. The full path name, including the new name, of the file.
ATTRIBUTES
Optional. A comma-delimited list of file attributes to be set on the file being
renamed. The following file attributes are supported:
• ReadOnly
• Temporary
• Archive
• Hidden
• System
• Normal
If ATTRIBUTES is not used, the file’s attributes are maintained. If Normal is
specified as well as any other attributes, Normal is overridden by whatever other
attribute is specified.
Individual attributes must be specified explicitly. For example, if you specify just
the ReadOnly attribute, all other existing attributes are overwritten.