Chapter 1: ColdFusion Tags
55
<CFOUTPUT>#Message#</CFOUTPUT>
ColdFusion supports a number of powerful functions for manipulating the contents of
text files. You can also use variable created by a CFFILE Read operation in ArrayToList
and ListToArray functions.
See
String Functions
and
Array Functions
for more information about working with
strings and arrays.
CFFILE ACTION="ReadBinary"
You can use the CFFILE tag to read an existing binary file, such as an executable or
image file. The file is read into a binary object parameter you can use anywhere in the
page like any other parameter. If you would like to send it through one of the Web
protocols, such as HTTP or SMTP, or store it in a database, you should first convert it to
Base 64 (see
ToBase64
).
Syntax
<CFFILE ACTION="ReadBinary"
FILE="full_path_name"
VARIABLE="var_name">
FILE
Required. The full path name of the file to be read.
VARIABLE
Required. The name of the variable that will contain the contents of the binary file
after it has been read.
Example
The following example creates a variable named "aBinaryObj " that will contain the
ColdFusion Server executable.
<CFFILE ACTION="ReadBinary"
FILE="c:\cfusion\bin\cfserver.exe"
VARIABLE="aBinaryObj">
You can then convert the binary file to Base 64 so that you could FTP it to another site
for upload.
CFFILE ACTION="Write"
You can use the CFFILE tag to write a text file based on dynamic content. For example,
you could create static HTML files from this content or log actions in a text file.
Syntax
<CFFILE ACTION="Write"
FILE="full_path_name"
OUTPUT="content"
MODE="permission"
ADDNEWLINE="Yes/No"
ATTRIBUTES="file_attributes">
Содержание COLDFUSION 4.5-CFML LANGUAGE
Страница 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Страница 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Страница 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Страница 296: ...272 CFMLLanguageReference INPUT TYPE text NAME number2 BR INPUT TYPE submit NAME submit VALUE Add FORM BODY HTML...
Страница 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Страница 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Страница 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Страница 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Страница 557: ...Chapter 2 ColdFusion Functions 533 P CFOUTPUT Value i is employee keysToStruct i CFOUTPUT P CFLOOP CFIF BODY HTML...
Страница 584: ...560 CFMLLanguageReference...
Страница 594: ...570 CFMLLanguageReference...