Use the CFFILE tag to handle all interactions with files. The attributes you use with CFFILE depend on the value of the ACTION attribute. For example, if the ACTION is "Write, " ColdFusion expects the attributes associated with writing a text file. See the individual CFFILE topics below for details about which attributes apply to which ACTIONs.
Note | The Basic Security settings may prevent CFFILE from executing. These settings are managed using the Basic Security page in the ColdFusion Administrator. In order for CFFILE to execute, it needs to be enabled on the Basic Security page. |
If you write ColdFusion applications designed to run on a server that is used by multiple customers, you need to consider the security of the files that could be uploaded or otherwise manipulated by CFFILE. See Administering ColdFusion Serverfor more information about securing ColdFusion tags.
Depending on the value you assign to the ACTION attribute of CFFILE, there are several additional attributes you can set. This table shows which attributes you can use with each CFFILE ACTION.
Attributes Used with CFFILE ACTIONs | |
---|---|
ACTION | Attributes |
Upload |
ACCEPT DESTINATION FILEFIELD NAMECONFLICT MODE ATTRIBUTES |
Move |
SOURCE DESTINATION ATTRIBUTES |
Rename |
SOURCE DESTINATION ATTRIBUTES |
Copy |
SOURCE DESTINATION ATTRIBUTES |
Delete | FILE |
Read |
FILE VARIABLE |
ReadBinary |
FILE VARIABLE |
Write |
OUTPUT FILE MODE ADDNEWLINE ATTRIBUTES |
Append |
OUTPUT FILE MODE ADDNEWLINE ATTRIBUTES |
Sections that follow describe these values and attributes in greater detail.