loadTextFile

Available for: Content Management Server, Template Engine

Task: Returns the contents of the specified text file.

Syntax:

loadTextFile filename [charset]

Function parameters:

  • filename is the name of the file.
  • charset is the character encoding name of the file to read. This parameter is optional. The default value is utf-8. Enter encoding names in the Tcl shell to retrieve the list of known character encodings.

Return value if successful: the contents of the file

Necessary permissions (CM only): no restrictions

Example:

CM>set a [loadTextFile /tmp/textfile iso8859-1]