How To The Write `<cffile action = “append”>` Function In ColdFusion?
Description:-
Appends text string to a text file on the server.
<cffile
action = "append"
file = "full pathname"
output = "string"
addNewLine = "yes|no"
attributes = "file attributes list"
charset = "characterset option"
fixnewline = "yes|no"
mode = "mode"
>
Attributes:-
action
:- This is a required attribute, the type of file manipulation that the tag performs.
file
:- This is a required attribute, The pathname of the file to which to append the content of the output attribute.
output
:- This is a required attribute, the string test which needs to be appended to the file.
addNewLine
:- This is a non-required attribute, the default value is yes
,
yes
:- appends a newline character to text written to the file.
no
:- for not adding a new line.
attributes
:- This is a non-required attribute, A comma-delimited list of attributes to set on the file that applies to Windows. the values are:-
readOnly
hidden
normal
charset
:- This is a non-required attribute, JVM default file character set for the default value, 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
fixnewline
:- This is a non-required attribute, the default value is no
.
yes
:- changes embedded line-ending characters in string variables to operating-system-specific line endings.
no
:- do not change embedded line-ending characters in string variables.
mode
:- This is a non-required attribute and applies only to UNIX and Linux. Permissions. Octal values of UNIX chmod command. Assigned to owner, group, and other, respectively.
644
:- assigns read/write permission to the owner; read permission to group and others.
777
:- assigns read/write/execute permission to all.
Example:-
<cffile action = "append" file = "\temp\test" attributes = "normal" output = "This is a test">