•
Changed directory path requirements for the
specify in the
destination
•
Deprecated the
•
Deprecated the
synonym for
normal
•
Changed the
action
attribute,
charset
•
The
value of the
archive
Example
<!--- This shows how to write, read, update, and delete a file using CFFILE
--->
This is a view-only example.
<!---
<cfif IsDefined("form.formsubmit") is "Yes">
<!--- form has been submitted, now do the action --->
<cfif form.action is "new">
<!--- make a new file --->
<cffile action="Write"
file="#GetTempDirectory()#foobar.txt"
output="#form.the_text#">
</cfif>
<cfif form.action is "read">
<!--- read existing file --->
<cffile action="Read"
file="#GetTempDirectory()#foobar.txt"
variable="readText">
</cfif>
<cfif form.action is "add">
<!--- update existing file --->
<cffile action="Append"
file="#GetTempDirectory()#foobar.txt"
output="#form.the_text#">
</cfif>
<cfif form.action is "delete">
<!--- delete existing file --->
<cffile action="Delete"
file="#GetTempDirectory()#foobar.txt">
</cfif>
</cfif>
<!--- set some variables --->
<cfparam name="fileExists" default="no">
<cfparam name="readText" default="">
<!--- first, check if canned file exists --->
<cfif FileExists("#GetTempDirectory()#foobar.txt") is "Yes">
<cfset fileExists="yes">
</cfif>
<!--- now, make the form that runs the example --->
<form action="index.cfm" method="POST">
<h4>Type in some text to include in your file:</h4> <p>
<cfif fileExists is "yes">
A file exists (foobar.txt, in <cfoutput>#GetTempDirectory()#</cfoutput>).
You may add to it, read from it, or delete it.
</cfif> <
!--- if reading from a form, let that information display in textarea --->
attribute does not require a trailing slash.
value of the
system
attributes
value of the
temporary
. It might not work in later releases.
attribute options
.
attributes
attribute: a directory path that you
destination
attribute.
attribute. In ColdFusion MX, it is a
attributes
,
,
read
write
append
attribute is obsolete and has no effect.
and
: they support a new
move
cffile
111