54
CFML Language Reference
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 "backup. "
CFFILE ACTION="Delete"
The CFFILE tag can be used to delete a file on the server.
Syntax
<CFFILE ACTION="Delete"
FILE="full_path_name">
FILE
Required. The full path name of the file to delete.
Example
The following example permanently deletes the specified file:
<CFFILE ACTION="Delete"
FILE="c:\files\upload\#Variables.DeleteFileName#">
CFFILE ACTION="Read"
You can use the CFFILE tag to read an existing text file. The file is read into a dynamic
parameter you can use anywhere in the page like any other dynamic parameter. For
example, you could read a text file and then insert its contents into a database. Or you
could read a text file and then use one of the find and replace functions to modify its
contents.
Syntax
<CFFILE ACTION="Read"
FILE="full_path_name"
VARIABLE="var_name">
FILE
Required. The full path name of the text file to be read.
VARIABLE
Required. The name of the variable that will contain the contents of the text file
after it has been read.
Example
The following example creates a variable named "Message " that will contain the
contents of the file message.txt.
<CFFILE ACTION="Read"
FILE="c:\web\message.txt"
VARIABLE="Message">
The variable "Message" could then be used in the page. For example, you could display
the contents of the
message.txt
file in the final Web page:
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...