MACROMEDIA COLDFUSION MX 61-CFML Reference page 128

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

Attribute
Req/Opt
attributes
Optional
charset
Optional
Example
This example creates a file with information a user entered in an HTML insert form:
<cffile action = "write"
file = "c:\files\updates\#Form.UpdateTitle#.txt"
output = "Created By: #Form.FullName#
Date: #Form.Date#
#Form.Content#">
If the user submitted a form with the following:
UpdateTitle = "FieldWork"
FullName = "World B. Frueh"
Date = "10/30/01"
Content = "We had a wonderful time in Cambridgeport."
ColdFusion would create a file named FieldWork.txt in the c:\files\updates\ directory and the file
would contain the following text:
Created By: World B. Frueh
Date: 10/30/01
We had a wonderful time in Cambridgeport.
This example shows the use of the
permissions rw-r--r-- (owner = read/write, group = read, other = read):
<cffile action = "write"
file = "/tmp/foo"
mode = 644>
This example appends to the file and sets permissions to read/write (rw) for all:
128
Chapter 2: ColdFusion Tags
Default
Description
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"
overwritten.
• readOnly
• hidden
• normal
JVM
The character encoding in which the file contents is
default file
encoded. The following list includes commonly used values:
character
• utf-8
set.
• 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.
attribute for UNIX. It creates the file /tmp/foo with
mode
, all other attributes are

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents