User Guide

132 Chapter 2: ColdFusion Tags
Example
<!--The first example creates the file \temp\foo on a windows system and sets
attributes to normal. --->
<cffile action = "write" file = "\temp\foo" attributes = normal output = "some
text">
<!--- The second example appends to the file. --->
<cffile action = "append" file = "\temp\foo" attributes = normal output = "Is
this a test?">
attributes Optional Applies to Windows. A comma-delimited list of attributes to
set on the file.
If omitted, the file’s attributes are maintained.
Each value must be specified explicitly. For example, if you
specify
attributes = "readOnly", all other attributes are
overwritten.
readOnly
hidden
normal
charset Optional JVM
default file
character
set
The character encoding in which the file contents is
encoded. The following list includes commonly used values:
utf-8
iso-8859-1
windows-1252
us-ascii
shift_jis
iso-2022-jp
euc-jp
euc-kr
big5
euc-cn
utf-16
For more information character encodings, see
www.w3.org/International/O-charset.html.
fixnewline Optional No Yes: changes embedded line-ending characters in string
variables to operating-system specific line endings
No: (default) do not change embedded line-ending
characters in string variables.
See “cffile action = "write"” for an example that uses this
attribute.
Attribute Req/Opt Default Description