cffile action = "rename"

Description

Use cffile with the rename action to rename a file on the server.

Category

File management tags

Syntax

<cffile action = "rename"
  source = "full_path_name"
  destination = "full_path_name"
  attributes = "file_attributes"> 

See also

cfdirectory

Attributes

Attribute
Description
source
Required. The full pathname of the file to rename.
destination
Required. The full pathname, 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 with any other attributes, normal is overridden by whatever other attribute is specified.
Individual attributes must be specified explicitly. For example, if you specify only the readOnly attribute, all other existing attributes are overwritten.

Example

The following example renames the file keymemo.doc to oldmemo.doc:

<cffile action = "rename"
  source = "c:\files\memo\keymemo.doc" 
  destination = "c:\files\memo\oldmemo.doc">