SetMode (FtpsClient object)¶
Warning
This method is defined only for the FtpsClient object. Any attempt to use this method with any other client object will result in a failure and run-time crash of your script.
function SetMode(mode): boolean
Accepted values for the mode
parameter are:
ModeBinary
: tells the FTP server we want a binary file transfer
ModeASCII
: tells the FTP server we want an ASCII file transfer
The SetMode()
sends a MODE command to the FTP server to request that the
next file transfer(s) be operated either in binary ot ASCII mode.
If the MODE request is successful, this function returns true, otherwise it returns false.
Example:
{
var cli = new FtpsClient();
cli.Host = 'your.sftpserver.com:21';
cli.User = 'someusername';
cli.PassFromSecret = 'my_secret_name';
cli.TLS = TLSExplicit;
cli.SetMode(ModeBinary);
if (cli.Connect()) {
// perform your file transfers...
// ...
// ...
cli.Close();
}
cli = null
}