The mgiModifyFile Tag

Tag Behavior

Use the mgiModifyFile tag to overwrite or append to an existing file.


Tag Syntax

The mgiModifyFile tag has two required parameters and one optional parameter. The tag form is:

<mgiModifyFile fileLocation="File Path" mode="Mode" 
appendCRLF="Yes/No">
MGI Tags, HTML or Text
</mgiModifyFile>

Required Parameters:

  • fileLocation - The fileLocation is the relative path to the file to modify. If the file does not exist, it will be created.
  • mode - The mode is the function that the mgiModifyFile tag performs. In "write" mode, the mgiModifyFile tag overwrites the contents of the file listed in the fileLocation parameter with the information in the body of the mgiModifyFile tag. In "append" mode, the mgiModifyFile tag appends the information in the body of the mgiModifyFile tag to the end of the file listed in the fileLocation parameter.

Optional Parameters:

  • appendCRLF - The appendCRLF parameter determines whether a carriage return and line feed are appended after the information in the body of the mgiModifyFile tag is written or appended. If the appendCRLF parameter value is "Yes", then a carriage return (Mac) or a carriage return and line feed (NT) are appended. If the appendCRLF parameter value is "No", then no characters (visible or hidden) are appended. The default value is "Yes"


Example Usage and Output

<mgiModifyFile mode="append" 
fileLocation="contestants.txt" appendCRLF="Yes">
<mgiPostArgument name="Name"> <mgiPostArgument name="Email"> 
<mgiPostArgument name="Phone"> 
</mgiModifyFile>

In this example, visitors register for a contest and their information is appended to a file named contestants.txt


Suggested Usage

  • Contests
  • Web-Based Dynamic Content Updates


[Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]


[MGI Guides Main Menu] [User Guide Main Menu]