Features Property  
 

Gets and sets the features enabled for the current client session.

Syntax

object.Features [= flags ]

Remarks

The Features property returns a value which may be a combination of one or more of the following bit flags:

Value Description
&H00001 ftpFeatureSIZE 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 MLST or STAT command to determine the file size.
&H00002 ftpFeatureSTAT 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.
&H00004 ftpFeatureMDTM 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.
&H00008 ftpFeatureREST 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.
&H00010 ftpFeatureSITE 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.
&H00020 ftpFeatureIDLE 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.
&H00040 ftpFeatureCHMOD 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.
&H00080 ftpFeatureAUTH The server supports explicit TLS 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 TLS connections. Changing this feature has no effect on standard, non-secure connections.
&H00100 ftpFeaturePBSZ 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.
&H00200 ftpFeaturePROT 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.
&H00400 ftpFeatureCCC 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.
&H00800 ftpFeatureHOST The server supports the HOST command which enables a client to specify the hostname after establishing a connection with a server that supports virtual hosting.
&H01000 ftpFeatureMLST The server supports the MLST command which returns status information for files. If this feature is enabled, the MLST command will be used instead of the STAT command.
&H02000 ftpFeatureMFMT The server supports the MFMT command which is used to change the last modification time for a file. If this command is supported, it is used instead of the MDTM command to change the modification time for a file.
&H04000 ftpFeatureXCRC The server supports the XCRC command which returns the CRC-32 checksum for the contents of a specified file. This command is used for file verification.
&H08000 ftpFeatureMD5 The server supports the XMD5 command which returns an MD5 hash for the contents of a specified file. This command is used for file verification.
&H10000 ftpFeatureLANG The server supports the LANG command which sets the language used for the current client session. Command responses and file naming conventions will use the specified language.
&H20000 ftpFeatureUTF8 The server supports the OPTS UTF-8 command which specifies UTF-8 encoding when specifying filenames. This feature is typically used in conjunction with setting the default language for the client session.
&H40000 ftpFeatureXQUOTA The server supports the XQUOTA command which returns quota information for the current client session.
&H80000 ftpFeatureUTIME The server supports the UTIME command which is used to change the last modification time for a specified file.

When a client connection is first established, the FEAT command is sent to the server to determine what features are available. 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 (FtpClient1.Features And ftpFeatureSIZE) <> 0 Then
    FtpClient1.Features = FtpClient1.Features And Not ftpFeatureSIZE
    FtpClient1.Features = FtpClient1.Features Or ftpFeatureSTAT
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.

Data Type

Integer (Int32)

See Also

Encoding Property, Connect Method,