The GetFileType method returns the default file type for
the current client session.
Parameters
None.
Return Value
If the method succeeds, the return value is an integer value that identifies
the current file type. If the method fails, the return value is FTP_ERROR. To get
extended error information, call GetLastError.
Remarks
The GetFileType method will return one of the following values:
Value |
Description |
FILE_TYPE_AUTO |
The file type should be automatically determined based on
the file name extension. If the file extension is unknown, the
file type should be determined based on the contents of the
file. The library has an internal list of common text file
extensions, and additional file extensions can be registered
using the RegisterFileType method. |
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 file and no data conversion of any type
is performed on the file. This is the default file type for most
data files and executables. If the type of file cannot be
automatically determined, it will always be considered a binary
file. |
If this method is called when connected to an SFTP (SSH) server,
the default file type will always be FILE_TYPE_IMAGE because SFTP does
not differentiate between text files and binary files.
The SetFileType function can be used to change the
default file type. To determine the automatic file type for a specific
file based on its extension or contents, use the GetAutoFileType
method.
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
GetAutoFileType,
OpenFile,
RegisterFileType,
SetFileMode,
SetFileStructure,
SetFileType,
SetPassiveMode
|