[WriteFile FileName]Text[/WriteFile]
To write text to an arbitrary text file, put a [WriteFile] context into a template. WriteFile creates a new file if one does not exist already, and erases any existing text if the file was already there. The file should not be a database file that WebCatalog currently has open. See [AppendFile].
Example (normally you would put the following text into a .tpl file on your server and use a web browser to link to it):
Try It!
The text file "SomeTextFile" is created and opened, and the text
Hello, my name is Grant. The time is 13:43:01 This is a second line
is written to the file. Notice that carriage returns inside the context are written to the file exactly as they appear. Also notice that any WebCatalog [xxx] tags inside the context are substituted for their real values before being written to the file. You may specify a full or partial URL to the file, as in "/Some Folder/file.txt" or "LocalFolder/file.txt".
| Parameter | Description |
|---|---|
|
|
|
|
file |
When you use the secure option above, you must also provide the name (or URL path) of the file to create. |