CFtpClient::RegisterFileType Method  
 
BOOL RegisterFileType(
  LPCTSTR lpszExtension,  
  UINT nFileType  
);

The RegisterFileType method associates a file name extension with a specific file type.

Parameters

lpszExtension
A null-terminated string which specifies the file name extension. If this parameter is NULL or points to an empty string, the default file type will be changed for the client session.
nFileType
Specifies the type of file associated with the file extension. This parameter can be one of the following values.
Value Description
FILE_TYPE_ASCII The file is a text file using the ASCII character set. For those servers which mark the end of a line with characters other than a carriage return and linefeed, it will be converted to the native client format. This is the file type used for directory listings.
FILE_TYPE_EBCDIC The file is a text file using the EBCDIC character set. Local files will be converted to EBCDIC when sent to the server. Remote files will be converted to the native ASCII character set when retrieved from the server.
FILE_TYPE_IMAGE The file is a binary image and no data conversion of any type is performed on the file. This is typically the default file type for data file transfers. If the type of file that is being transferred is unknown, this file type should always be used.

Return Value

If the method succeeds, the return value is non-zero. If the method fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The RegisterFileType method is used to associate specific file types with file name extensions. The library has an internal list of standard text file extensions which it automatically recognizes. This method can be used to extend or modify that list for the client session.

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
Unicode: Implemented as Unicode and ANSI versions

See Also

GetAutoFileType, OpenFile, SetFileMode, SetFileStructure, SetFileType, SetPassiveMode