The Features property returns a value which may be a
combination of one or more of the following bit flags:
| Value |
Constant |
Description |
| 1 |
fileFeatureSize |
The server supports the SIZE command to
determine the size of a file. If this feature is not enabled, the
control will attempt to use the STAT command to determine the file
size. |
| 2 |
fileFeatureStat |
The server supports using the STAT command to
return information about a specific file. If this feature is not
enabled, the client may not be able to obtain information about a
specific file such as its size, permissions or modification
time. |
| 4 |
fileFeatureMdtm |
The server supports the MDTM command to obtain
information about the modification time for a specific file. This
command may also be used to set the file time on the server. |
| 8 |
fileFeatureRest |
The server supports restarting file transfers
using the REST command. If this feature is not enabled, the client
will not be able to restart file transfers and must upload or
download the complete file. |
| 16 |
fileFeatureSite |
The server supports site specific commands
using the SITE command. If this feature is not enabled, no site
specific commands will be sent to the server. |
| 32 |
fileFeatureIdle |
The server supports setting the idle timeout
period using the SITE IDLE command to specify the number of seconds
that the client may idle before the server terminates the
connection. |
| 64 |
fileFeatureChmod |
The server supports modifying the permissions
of a specific file using the SITE CHMOD command. If this feature is
not enabled, the client will not be able to set the permissions for
a file. |
| 128 |
fileFeatureAuth |
The server supports explicit SSL sessions using
the AUTH command. If this feature is not enabled, the client will
only be able to connect to a secure server that uses implicit SSL
connections. Changing this feature has no effect on standard,
non-secure connections. |
| 256 |
fileFeaturePbsz |
The server supports the PBSZ command which
specifies the buffer size used with secure data connections. If
this feature is disabled, it may prevent the client from changing
the protection level on the data channel. Changing this feature has
no effect on standard, non-secure connections. |
| 512 |
fileFeatureProt |
The server supports the PROT command which
specifies the protection level for the data channel. If this
feature is disabled, the client will be unable to change the
protection level on the data channel. Changing this feature has no
effect on standard, non-secure connections. |
| 1024 |
fileFeatureCcc |
The server supports the CCC command which
returns the command channel to a non-secure mode. Changing this
feature has no effect on standard, non-secure connections. |
When a client connection is first established, all features are
enabled by default. However, as the client issues commands to the
server, if the server reports that the command is unrecognized that
feature will automatically be disabled in the client.
For example, the first time an application calls the
GetFileSize method to determine the size of a file, the
control will try to use the SIZE command. If the server reports
that the SIZE command is not available, that feature will be
disabled and the control will not use the command again during the
session unless it is explicitly re-enabled. This is designed to
prevent the control from repeatedly sending invalid commands to a
server, which may result in the server aborting the connection.
Setting the Features property enables those features
which have been specified. More than one feature may be enabled by
combining the above constants using a bitwise Or operator. To test
if a particular feature has been enabled, use the bitwise And
operator. For example, in Visual Basic this can be done using the
And and Or operators:
' If the SIZE command is enabled, disable it and make sure
' that the STAT command is enabled instead
If (FileTransfer1.Features And fileFeatureSize) <> 0 Then
FileTransfer1.Features = FileTransfer1.Features And Not fileFeatureSize
FileTransfer1.Features = FileTransfer1.Features Or fileFeatureStat
End If
Because features are specific to the current session, once you
disconnect from the server they are reset. Even if you wish to
reconnect to the same server, you must explicitly set the
Features property again to those features which you wish to
enable. Setting the Features property when the control is
not connected to a server will cause the client session to only use
those specified features for the next connection that is
established. Setting the Features property during an active
connection will change the features available for that session.