The PutText method is used to upload the contents of a
string and store it as a text file
on the server. Although a String variable may contain binary data, this method
should only be used with strings which contain printable text. Always use the
PutData method if you wish to
upload binary data, using a Byte array instead of a String variable.
The text uploaded to the server is automatically converted from
Unicode using the code page specified by the CodePage property.
By default, text will be automatically converted to use UTF-8
encoding, however you can change this if you prefer to store the file
using a different localized encoding. In most cases it is recommended
you use UTF-8 to ensure the broadest compatibility with other
This method will always attempt to normalize the end-of-line character
sequence to match what is used on the server. This can
potentially result in a discrepancy between the size of a text file on
the server and the actual length of the string buffer. For example,
Windows uses a carriage return and linefeed pair (CRLF) to indicate
the end of a line of text. If you are storing the text in a file on a
UNIX system, it will be changed to use only a linefeed (LF) to
indicate the end of a line.
This method will always use an ASCII file transfer mode, regardless
of the value of the FileType property. If the string buffer
contains binary data, the resulting file may be empty or contain
unprintable characters as the result of the Unicode text conversion.