The WRITEFILE tag offers the ability to output textual data to a file. The tag does not
support absolute or '..' (parent) directory access. With this tag, files can only be
created or added to in the script directory. For security reasons, this is by design.
As well, the tag supports a CREATEDIR action that allows for the creation of a
directory under the current template directory. UPLOAD is also supported for HTML file uploads,
and the action SIZE is supported to report the size of a file or directory (directories are a
recursive size).
Note: WRITEFILE supports "virtual" paths. These paths can be configured
by the system administrator.
Attributes:
FILE
file or directory (relative to current directory or a virtual directory)
NAME
variable to receive success code (TRUE or FALSE)
ACTION
CREATE, APPEND (default), CREATEDIR and UPLOAD
FILEDATA
represents HTML FORM field name; used with ACTION="UPLOAD"
<!--- Write out a new data file ---> <SAWRITEFILE FILE="GuestBook.htm" ACTION="CREATE">
#entry# </SAWRITEFILE>
<!--- Read file and create a list with lines --->
<SAREADFILE FILE="SomeDir\SomeFile.dat" NAME=entry>
<SASET NAME=entry VALUE=MakeList( Char(10), entry )>
<!--- Write out (append) the data with line #'s ---> <SAWRITEFILE FILE="SomeDir\SomeFile.dat">
<SALOOP FROM=0 TO=entry.Length() NAME=count>
Line:#count+1# #entry#</SALOOP> </SAWRITEFILE>