The SetChannelMode method is used to change the default
mode for the specified channel, and is typically used to control
whether or not data is encrypted during a file transfer. If a
standard, non-secure connection has been established with the server,
an error will be returned if you specify the FTP_CHANNEL_SECURE mode
for either channel.
If you have established a secure connection and then specify the
FTP_CHANNEL_CLEAR mode for the command channel, the client will send
the CCC command to the server to indicate that commands should no
longer be encrypted. If the server does not support this command, an
error will be returned and the channel mode will remain unchanged.
Once the command channel has been changed to clear mode, it cannot be
changed back to secure mode. You must disconnect and re-connect to
the server if you want to resume sending commands over an encrypted
channel.
Changing the mode for the data channel requires that the server
support the PROT command. If this command is not supported by the
server, the method will fail and the channel mode will remain
unchanged.