CFtpClient::SetFeatures Method  
 
DWORD SetFeatures(
  DWORD dwFeatures  
);

The SetFeatures method specifies the server features available to the client.

Parameters

dwFeatures
An unsigned integer that specifies one or more features. Refer to the documentation for the GetFeatures method for a list of available features.

Return Value

If the method succeeds, the return value specifies the features that were previously enabled. If the method fails, it will return zero. Because it is possible that no features were enabled, a return value of zero does not always indicate an error. An application should call GetLastError to determine if an error code has been set.

Remarks

The SetFeatures method is used to enable a specific set of features for the current session. When a client connection is first established, all features are enabled based on the server type and the server's response to the FEAT command. 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. To enable or disable a specific feature, an application can use the EnableFeature method.

For example, the first time an application calls the GetFileSize method to determine the size of a file, the library 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 library will not use the command again during the session unless it is explicitly re-enabled. This is designed to prevent the library from repeatedly sending invalid commands to a server, which may result in the server aborting the connection.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools11.h
Import Library: csftpv11.lib

See Also

EnableFeature, GetFeatures