The mgiFileWrite Tag
The mgiFileWrite overwrites into a file the text in the body
of the tag. If the file does not exist, it will be created.
The mgiFileWrite tag has a beginning tag with no required
parameter and three optional parameters, a body, and an ending
tag. The tag form is:
<mgiFileWrite folderLocation="" fileLocation="File Path">
MGI tags or text
<mgiFileWrite folderLocation="New Folder Name" fileLocation="File Path"
sourceFile="File Name To Copy">
- fileLocation="File Path" where "File
Path" is the relative path to a target file. If the file
does not exist, it will be created with the information in the
body of the tag. If the file does exist, its contents will be
completely replaced with the information in the body of the tag.
- folderLocation="New Folder Name" where "New
Folder Name" is the name of a folder that is created at
the same file level as the page containing the mgiFileWrite tag.
A new folder is always created before the file is written, therefore
the new folder name can be included in the fileLocation parameter's
- sourceFile="File Name To Copy" where "File
Name To Copy" is the relative path to a source file that
is copied to the file location listed in the fileLocation parameter
(a relative path refers to the same level of the file structure
Example Usage and Output
New Event: <mgiFieldContent name="Event Box">
In this example, the mgiFileWrite tag is used to overwrite
the text of a "New Events" page. The event.txt file
is then included in another HTML page using the mgiFileInclude
- Form Processing
- Web Site Maintenance