Cffile Action="Readbinary; Cffile Action="Write - MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference

Cfml language reference
Table of Contents

Advertisement

Chapter 1: ColdFusion Tags
<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
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">
and
Array Functions
for more information about working with
55

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion 4.5

Table of Contents