This method is used to determine the file transfer type to be
used when uploading or downloading files. This method is called internally when
FILE_TYPE_AUTO is specified as the default file type. The return value
may be one of the following:
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. Not all servers
support this file type. It is recommended that you only specify
this type if you know that it is required by the server to
transfer data correctly. |
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 executable programs. If the type of file cannot be
automatically determined, it will always be considered a binary
file. If this file type is specified when uploading or
downloading text files, the native end-of-line character
sequences will be preserved. |
If the file extension or contents are not recognized, the default
file transfer type for the client session will be returned. This will
usually be FILE_TYPE_IMAGE, however this can be changed by calling the
RegisterFileType method. The file type for the current
client session can be explicitly set using the SetFileType
method.
If the bScanFile parameter is non-zero, the local file will
be opened in a shared reading mode and up to 4,096 bytes will be
examined to determine if it contains binary data. If the file is currently
locked or has been opened exclusively by another process, the file
type associated with the file extension will be returned instead.
Text files which contain UTF-16 text will always return a file type
of FILE_TYPE_IMAGE because they can contain non-ASCII characters and/or
embedded null characters.
If the bScanFile parameter is non-zero and the file type
cannot be determined based on the file name extension, the file
specified by lpszFileName must exist and be a regular file. If
the file does not exist, an error will be returned and the last error
code will be set to ST_ERROR_FILE_NOT_FOUND. If the bScanFile
parameter is zero, no errors will be returned if the file does not
exist, the function will only check the file name extension to
determine the file type. When downloading a file, the bScanFile
parameter should normally be zero because the local file may not exist
yet.