SmartFTP FTP Library
IFTPConnection Interface

The IFTPConnection interface is implemented by the FTPConnectionMTA and the FTPConnectionSTA class.

IFTPConnection
IDL
interface IFTPConnection : IDispatch;

VBScript

Dim objFTP
Set objFTP = CreateObject("sfFTPLib.FTPConnectionSTA")
...
Set objFTP = Nothing

 

JavaScript

var objFTP = new ActiveXObject("sfFTPLib.FTPConnectionSTA");

 

C#

CFTPConnectionMTA ftp = new CFTPConnectionMTA();

 

C++

#import "libid:7A3A786C-EB8C-43b3-BC10-8D09ACF5D195" version("1.5")
// Note: Uncomment for Microsoft Visual Studio 6.0
//#import "C:\Program Files\SmartFTP FTP Library\sfFTPLib.dll"

::CoInitializeEx(0, COINIT_MULTITHREADED); // Init COM
sfFTPLib :: IFTPConnectionPtr m_FTP;
m_FTP.CreateInstance(__uuidof(sfFTPLib::FTPConnectionMTA));
::CoUninitialize();
IFTPConnection Methods 
Description 
Aborts the current operation.
The OnAbort event is fired once the operation completed. 
Changes the current/working directory on the server. 
Sends the CDUP command to the server to go up one directory. 
Clears the command channel by sending a CCC command. If the CCC server reply is successful the control connection continues in non-secure mode. 
Closes the connection.
To ungracefully close the connection use the Disconnect method. 
Sends the specified command to the server. 
Connects to remote host. 
Continues a pending operation.
This method can resume an operation which returned with ftpErrorPaused or ftpErrorMoreData. 
This is CopyFile, a member of class IFTPConnection. 
Deletes a file from the server. 
Disconnects from the remote host.
To ungracefully close the connection use the Close method. 
This is Download, a member of class IFTPConnection. 
Downloads a file. 
Downloads a specified remote file to a specified local file. 
This is DownloadFileEx2, a member of class IFTPConnection. 
FXP downloads a specified remote file. 
FXP uploads a specified remote file. 
Retrieves the hash value of a file or portion specified with nStart and nLen. 
Retrieves the size of a specified file. 
Retrieves the machine list of the specified file. 
Retrieves the last modified time of a specified file.
On success the result is saved in the LastFileTime property. 
This is GetSpaceAvailable, a member of class IFTPConnection. 
Initializes a data transfer. 
Makes/Creates a new directory.
The clients sends a MKD command to create a new directory on the server. 
Creates a new empty file.
The clients sends the STOR command to create a new empty file on the server. 
Reads the content of the current working directory.
The result is stored in the Items property. 
Reads the content of the current working directory.
The result is stored in the Directory property. 
Reads the content of the current working directory and saves it into the specified local file. 
Reads the content of the current working directory and saves it into a specified local file. The function sends the command supplied in the argument directly to the server and opens a data connection for the directory listing. 
Removes the specified directory.
The client sends a RMD command to remove the directory. Due to the nature of FTP the directory is not removed if it's not empty. 
Renames the specified directory.
The client sends RNFR to initiate a rename and completes it with RNTO. 
Renames a file.
The client sends RNFR to initiate a rename and completes it with RNTO. 
Sets the creation time of the file. 
Wrapper for SetCreateTime
Sets the last modified time of the file. 
Wrapper for SetModifyTime
Sets the unix attributes of a remote file or folder.
The client sends a SITE CHMOD command. If the FTP command is not supported the function fails. 
Stat 
Sends STAT command to retrieve statistics or file listing. 
Uninitializes object and stops internal thread. 
Updates the WorkingDirectory property by sending a PWD command to the server. 
Uploads a specified local file to a specified remote file. 
Uploads a specified local file to a specified remote file. 
Reserved. 
IFTPConnection Properties 
Description 
The account name being used together with the ACCT command.
Default: empty 
Set asynchronous mode.
Default: false 
This is BaseSocketLayer, a member of class IFTPConnection. 
Busy 
Indicates whether an operation is in progress or paused. 
Retrieves the ClientId object. 
Specifies the code page used to perform conversations.
Default: -1 (Auto). 
Specified whether the protection of command channel (control connection).
Default: ftpDataProtectionPrivate 
Contains the connection status. 
The protection for secure data transfers.
Default: ftpDataProtectionClear 
When enabled a NOOP command is sent every 30 seconds during a data transfer. 
The data transfer mode.
Default: ftpDataTransferModeStream 
The speed limit in bytes/second of the data transfer.
Default: 0 (no limit) 
The data transfer type.
Default: ftpDataTransferTypeImage 
FEAT 
Specifies if the FEAT command is sent.
Default: true 
The size of the buffer in bytes when reading data from a local file.
Default: 32768 
Contains the FTPProxy object. 
Specifies whether the password is replaced with "(hidden)" in the OnStatus method and in the log file.
Default: true 
Host 
Host name of the server. 
Contains the URL to the IP repeater.
Default: empty 
Contains the items of the last successful call to the ReadDirectory method. 
Contains the number of bytes written during the last transfer. 
Contains the last command sent to the server. 
Returns the data connection error. 
Contains the error value from the last operation. 
Contains the hash value represented as a hex string from the last successful call to the GetFileHash method. 
Contains the file size of the last successful call to the GetFileSize method. 
Contains the file size (high 32-bit integer) of the last successful call to the GetFileSize method. 
Contains the file size (low 32-bit integer) of the last successful call to the GetFileSize method. 
Contains the file time from the last successful call to the GetModifyTime or GetCreateTime method. 
Contains the file time as a date/double from of the last successful call to to the GetModifyTime or GetCreateTime method. 
Contains the last FTPItem. 
Contains the last server reply. 
Contains the 3 digit reply code of the last server reply. 
This is LastSpaceAvailable, a member of class IFTPConnection. 
Contains the number of transferred bytes (64-bit) during the last data transfer. 
Contains the number of transferred bytes (high 32-bit integer) during the last data transfer. 
Contains the number of transferred bytes (low 32-bit integer) during the last data transfer. 
Contains the average transfer speed in bytes/second of the last data transfer. 
The start position of the last data transfer. 
The start position (high 32-bit integer) of the last data transfer. 
The start position (low 32-bit integer) of the last data transfer. 
Contains the total time in milliseconds of the last data transfer. 
Specifies whether to use the ports provided by the IFTPPortPool.
Default: false 
This is LimitSocketLayer, a member of class IFTPConnection. 
Specifies the LIST options to be used for the LIST command. 
This is LogFile, a member of class IFTPConnection. 
If true client sends USER/PASS/ACCT pair to login.
Default: true 
MLST 
Specifies whether to use the MLSD command to list directories.
Default: true 
Specifies whether to use passive mode.
Default: true 
 
Specifies whether to force using the server IP address for passive mode.
Default: true 
The password to login to the FTP server. 
Contains the IP address of the peer.
The value is represented as a string in the following format: a.b.c.d 
Port 
The port number of the server.
Default: 21 
The IP address being used when PortMode is set to ftpPortModeManual.
Default: empty 
Specifies the port mode for the PORT command.
Default: ftpPortModeDefault 
Specifies whether to fall back to PROT C if PROT P fails.
Default: true 
Specifies the protocol for the FTP connection.
Default: ftpProtocolNormal 
Specifies the protocol family of the connection.
Default: ftpProtocolFamilyUNSPEC 
The preferred protocol family.
Default: ftpProtocolFamilyINET4 
Contains the Proxy object. 
Specifies whether to the HOST command is sent.
Default: false 
Contains a server state. 
SSCN 
Specifies whether to use use the SSCN command.
Default: false 
This is SSLSocketLayer, a member of class IFTPConnection. 
Contains a StreamFilter.
Default: empty 
Specifies the timeout in seconds for the control and data connection.
Default: 30 
Interval in ms (1/1000 s) in which the OnTransferProgress event is fired.
Default: 1000 ms 
UPnP 
Specifies whether port mappings for Active Mode (PORT) are automatically created and removed for data connections if a UPnP enabled router is present. 
Specifies whether the component uses a message loop while waiting for an operation to return. The message loop dispatches the windows messages queued in the windows message queue.
Default:
FTPConnectionMTA: false
FTPConnectionSTA: true 
The user name to login to the FTP server.
Default: empty 
Returns the current working directory. (read-only)
The directory is extracted from the last successful PWD server reply. Double quotes are automatically converted. 
What do you think about this topic? Send feedback!
Copyright (c) by SmartSoft Ltd. All rights reserved.