AddFileType Method  

Associate a file name extension with a specific file type.


object.AddFileType( FileExtension, FileType )


A string that specifies the file name extension.
Specifies the type of file associated with the file extension. This parameter can be one of the following values:
Value Constant Description
1 ftpFileTypeText The file being transferred is an ASCII text file. The characters the mark the end of a line (for example, a carriage return/linefeed pair under MS-DOS) are automatically converted to the format used by the target operating system.
2 ftpFileTypeEBCDIC The file being transferred is a text file created using the EBCDIC character set. If a file is being uploaded, ASCII characters are automatically converted to EBCDIC. If the file is being downloaded, EBCDIC characters are automatically converted to ASCII.
3 ftpFileTypeBinary The file is transferred without any modification. This is the default file transfer type, and should be used when transferring binary (non-text) data.

Return Value

A value of zero is returned if the operation was successful, otherwise a non-zero error code is returned which indicates the cause of the failure.


The AddFileType method is used to associate specific file types with file name extensions. The control 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.

See Also

Features Property, FileType Property, GetFileStatus Method, GetFileTime Method