|
SmartFTP FTP Library
|
import "sfFTPLib.idl";
Public Member Functions | |
| HRESULT | Abort () |
| Cancels the currently executing blocking operation. | |
| HRESULT | Continue () |
| Continues a pending operation. | |
| HRESULT | Close () |
| Closes the connection. | |
| HRESULT | Connect () |
| Establishes a connection to the configured remote host and port. | |
| HRESULT | Disconnect () |
| Gracefully disconnects from the remote host. | |
| HRESULT | ChangeDirectory ([in] BSTR directory) |
| Changes the current working directory on the server. | |
| HRESULT | UpdateWorkingDirectory () |
| Synchronizes the local WorkingDirectory property with the server. | |
| HRESULT | DownloadFile ([in] BSTR remoteFile, [in] BSTR localFile, [in] long startPositionLo, [in] long startPositionHi) |
| Downloads a file from the current working directory on the remote server. | |
| HRESULT | DownloadFromCommand ([in] BSTR command, [in] VARIANT localFile, [in] long remoteStartPosLo, [in] long remoteStartPosHi) |
| HRESULT | DownloadFileEx ([in] BSTR remoteFile, [in] VARIANT localFile, [in] ULONGLONG startPosition, [in] ULONGLONG endPosition, [in] ITransferProgressEvents *progress) |
| Downloads a file from the current working directory on the remote server with extended options. | |
| HRESULT | UploadFile ([in] BSTR localFile, [in] BSTR remoteFile, [in] long startPositionLo, [in] long startPositionHi) |
| Uploads a local file to the current working directory on the remote server. | |
| HRESULT | UploadFileEx ([in] VARIANT localFile, [in] BSTR remoteFile, [in] ULONGLONG startPosition, [in] ITransferProgressEvents *progress) |
| Uploads a file or stream to the remote server with extended options. | |
| HRESULT | NewFile ([in] BSTR file) |
| Creates a new, empty (zero-byte) file on the remote server. | |
| HRESULT | ChangeDirectoryUp () |
| Changes the current working directory to the parent directory on the remote server. | |
| HRESULT | RenameFile ([in] BSTR fileFrom, [in] BSTR fileTo) |
| Renames or moves a file on the server. | |
| HRESULT | DeleteFile ([in] BSTR file) |
| Deletes a file from the current working directory on the server. | |
| HRESULT | RenameDirectory ([in] BSTR directoryFrom, [in] BSTR directoryTo) |
| Renames or moves a directory on the server. | |
| HRESULT | RemoveDirectory ([in] BSTR directory) |
| Removes a directory from the server. | |
| HRESULT | Command ([in] BSTR command) |
| Sends a raw string command to the server. | |
| HRESULT | MakeDirectory ([in] BSTR directory) |
| Creates a new directory on the server. | |
| HRESULT | GetFileSize ([in] BSTR file, [out, retval] ULONGLONG *retval) |
| Retrieves the size of a specified file on the server. | |
| HRESULT | GetFileSize32 ([in] BSTR file, [out, retval] long *retval) |
| Retrieves the size of a specified file on the server (for legacy applications). | |
| HRESULT | ReadDirectory ([out, retval] IFTPItems **retval) |
| Retrieves the contents of the current working directory on the server. | |
| HRESULT | ReadDirectoryEx ([in] ITransferProgressEvents *progress, [out, retval] IFTPItems **retval) |
| HRESULT | ReadDirectoryFromCommand ([in] BSTR command, [out, retval] IFTPItems **retval) |
| HRESULT | ReadDirectoryRaw ([in] VARIANT localFile) |
| Downloads the raw directory listing from the server to a local file. | |
| HRESULT | GetModifyTime ([in] BSTR file, [out, retval] FILETIME *retval) |
| Retrieves the last modified time of a specified file on the server. | |
| HRESULT | GetModifyTimeAsDate ([in] BSTR file, [out, retval] VARIANT *retval) |
| Retrieves the last modified time of a specified file on the remote server. | |
| HRESULT | GetMLST ([in] BSTR name, [out, retval] IFTPItem **retval) |
| HRESULT | Stat ([in] BSTR name, [out, retval] IFTPItems **retval) |
| Retrieves file status or a directory listing using the control connection. | |
| HRESULT | SetModifyTime ([in] BSTR file, [in] FILETIME time) |
| Sets the modification timestamp of a file on the remote server. | |
| HRESULT | SetModifyTimeAsDate ([in] BSTR file, [in] VARIANT date) |
| Sets the modification timestamp of a file using an OLE Automation Date. | |
| HRESULT | SetCreateTime ([in] BSTR file, [in] FILETIME time) |
| Sets the creation timestamp of a file on the remote server. | |
| HRESULT | SetCreateTimeAsDate ([in] BSTR file, [in] VARIANT date) |
| Sets the creation timestamp of a file using an OLE Automation Date. | |
| HRESULT | SetUnixPermissions ([in] BSTR name, [in] long permissions) |
| Sets the Unix permissions (mode) of a remote file or directory. | |
| HRESULT | GetFileHash ([in] HashAlgo algo, [in] BSTR file, [in] ULONGLONG start, [in] ULONGLONG length, [out, retval] BSTR *retval) |
| Retrieves the hash value of a file or portion specified with start and length. | |
| HRESULT | ClearCommandChannel () |
| Clears the command channel. | |
| HRESULT | InitializeTransfer () |
| Explicitly applies data transfer settings to the server. | |
| HRESULT | FXPDownloadFile ([in] BSTR remoteFile, [in] ULONGLONG startPosition) |
| Initiates a server-to-server (FXP) file transfer from this server. | |
| HRESULT | FXPUploadFile ([in] BSTR remoteFile, [in] ULONGLONG startPosition) |
| Initiates a server-to-server (FXP) file transfer to this server. | |
| HRESULT | GetSpaceAvailable ([in] BSTR path, [out, retval] ISFTPSpaceAvailable **retval) |
| Retrieves the available disk space information for a specified path on the server. | |
| HRESULT | CopyFile ([in] BSTR sourceFile, [in] BSTR destinationFile) |
| HRESULT | SetFileLogger ([out, retval] IFileLogger **fileLogger) |
| Creates a file logger sfFTPLib::FileLogger and attaches it to the Logger property. | |
Properties | |
| VARIANT_BOOL | Busy [get] |
| Indicates whether the connection is currently executing an operation. | |
| VARIANT_BOOL | Aborted [get] |
| Indicates whether the last operation was explicitly cancelled by the user. | |
| VARIANT_BOOL | UseMessageLoop [get, set] |
| Controls whether the component processes Windows messages during blocking operations. | |
| long | Timeout [get, set] |
| Sets the maximum time (in seconds) to wait for a network operation to complete. | |
| ConnectionStatus | ConnectionStatus [get] |
| Retrieves the current state of the SSH connection. | |
| BSTR | Host [get, set] |
| Specifies the destination server address. | |
| long | Port [get, set] |
| Specifies the TCP port number to connect to. | |
| ProtocolFamily | ProtocolFamilyPreference [get, set] |
| Controls the preference for IPv4 or IPv6 during hostname resolution. | |
| ProtocolFamily | ProtocolFamily [get] |
| Retrieves the network protocol family (IPv4 or IPv6) used for the active connection. | |
| VARIANT_BOOL | Login [get, set] |
| Controls whether the component automatically performs the USER/PASS authentication sequence upon connection. | |
| BSTR | Username [get, set] |
| Gets or sets the username used for authentication. | |
| BSTR | Password [get, set] |
| Gets or sets the password used for authentication. | |
| FTPProtocol | Protocol [get, set] |
| Gets or sets the security protocol used for the connection. | |
| PortMode | PortMode [get, set] |
| Controls how the client determines the IP address sent in the PORT command (Active Mode). | |
| BSTR | PortIP [get, set] |
| Specifies the IP address sent to the server during Active Mode (PORT) negotiations. | |
| VARIANT_BOOL | Passive [get, set] |
| Controls whether the data connection is established in Passive (PASV) or Active (PORT) mode. | |
| DataTransferType | DataTransferType [get, set] |
| Gets or sets the transfer mode (ASCII vs. Binary) for file operations. | |
| DataProtection | DataProtection [get, set] |
| DataProtection | CommandProtection [get, set] |
| VARIANT_BOOL | PROTFallback [get, set] |
| Controls whether the client falls back to an unencrypted data channel if encrypted data transfer (PROT P) fails. | |
| long | CodePage [get, set] |
| PassiveMode | PassiveMode [get, set] |
| Controls how the client determines the target IP address for Passive Mode data connections. | |
| VARIANT_BOOL | LimitLocalPortRange [get, set] |
| Enables the use of a specific pool of local ports for data connections. | |
| VARIANT_BOOL | UseMLSD [get, set] |
| Controls whether the component uses the MLSD command if supported by the server. | |
| DataTransferMode | DataTransferMode [get, set] |
| Gets or sets the transmission mode (Stream, Block, or Compressed) used for data transfer. | |
| long | LISTOption [get, set] |
| Gets or sets the flags used for the FTP LIST command. | |
| long | DataTransferSpeedLimit [get, set] |
| Sets a maximum bandwidth limit for data transfers. | |
| VARIANT_BOOL | SSCN [get, set] |
| Enables or disables the sending of the SSCN command for secure FXP transfers. | |
| FeatureDiscoveryMode | FeatureDiscovery [get, set] |
| Configures when the FEAT command is sent to discover server capabilities. | |
| long | FileBufferSize [get, set] |
| Sets the size of the internal memory buffer used for local file I/O operations. | |
| VARIANT_BOOL | IdleKeepAlive [get, set] |
| Enables automatic "keep-alive" packets to prevent connection timeouts during inactivity. | |
| VARIANT_BOOL | TransferKeepAlive [get, set] |
| Enables the sending of NOOP commands on the Control Channel during active file transfers. | |
| long | KeepAliveInterval [get, set] |
| Sets the time interval (in seconds) between automatic keep-alive packets. | |
| IFTPClientId | ClientId [get, set] |
| Gets or sets the client identification information sent to the server via the CSID and CLNT commands. | |
| VARIANT_BOOL | HidePassword [get, set] |
| Controls whether the password is masked in the component's log output. | |
| BSTR | WorkingDirectory [get] |
| Retrieves the current remote working directory. | |
| BSTR | PeerName [get] |
| Retrieves the IP address of the currently connected remote server. | |
| IFTPServerState | ServerState [get] |
| Retrieves the interface used to inspect the current state of the server session. | |
| IProxySettings | Proxy [get] |
| Accesses the proxy configuration settings for the connection. | |
| ITlsSocket | SSLSocketLayer [get] |
| Retrieves the underlying TLS socket object used for secure communication. | |
| ISocketSettings | SocketSettings [get] |
| Accesses the low-level TCP socket configuration. | |
| ISpeedLimitSettings | SpeedLimitSettings [get] |
| Accesses the bandwidth throttling configuration for this specific connection. | |
| ILogger | Logger [set] |
| Attaches a logging mechanism to the FTP session for debugging and auditing. | |
| long | CompressionLevel [get, set] |
| Controls the aggressiveness of the zlib compression algorithm. | |
| BSTR | LastReply [get] |
| Retrieves the raw text response received from the FTP server for the most recent command. | |
| long | LastReplyCode [get] |
| Retrieves the numeric status code returned by the FTP server for the most recent command. | |
| BSTR | LastCommand [get] |
| Retrieves the raw text of the most recent FTP command sent to the server. | |
| HRESULT | LastError [get] |
| Retrieves the HRESULT error code of the most recent operation. | |
| HRESULT | LastDataConnectionError [get] |
| Retrieves the specific error code encountered on the Data Channel socket. | |
| ULONGLONG | LastTransferBytes [get] |
| Retrieves the total number of bytes transferred during the last SFTP transfer. | |
| long | LastTransferBytesLo [get] |
| Retrieves the lower 32 bits of the last transfer size. | |
| long | LastTransferBytesHi [get] |
| Retrieves the upper 32 bits of the last transfer size. | |
| long | LastTransferTime [get] |
| Retrieves the duration of the last FTP transfer in milliseconds. | |
| long | LastTransferSpeed [get] |
| Retrieves the average data transfer rate of the last FTP transfer. | |
| BSTR | PassiveAddress [get, set] |
| Specifies or retrieves the IP address used for Server-to-Server (FXP) data connections. | |
| BSTR | Account [get, set] |
| Gets or sets the account information used for the ACCT command. | |
| HRESULT IFTPConnection::Abort | ( | ) |
Cancels the currently executing blocking operation.
| HRESULT IFTPConnection::ChangeDirectory | ( | [in] BSTR | directory | ) |
Changes the current working directory on the server.
The CWD command is sent to request a directory change.
| [in] | directory | The relative or absolute path of the target directory. |
| HRESULT IFTPConnection::ChangeDirectoryUp | ( | ) |
Changes the current working directory to the parent directory on the remote server.
This method sends the standard CDUP (Change Directory Up) command. It is functionally equivalent to calling ChangeDirectory("..").
| HRESULT IFTPConnection::ClearCommandChannel | ( | ) |
Clears the command channel.
Executes the 'CCC' (Clear Command Channel) command. If successful, the control connection continues in non-secure mode.
| HRESULT IFTPConnection::Close | ( | ) |
Closes the connection.
To ungracefully close the connection use the Disconnect method.
| HRESULT IFTPConnection::Command | ( | [in] BSTR | command | ) |
Sends a raw string command to the server.
| [in] | command | The command string to send (e.g., "NOOP"). |
| HRESULT IFTPConnection::Connect | ( | ) |
Establishes a connection to the configured remote host and port.
| HRESULT IFTPConnection::Continue | ( | ) |
Continues a pending operation.
This method can resume an operation which returned with FTPLIB_E_PAUSED or FTPLIB_E_MOREDATA.
| HRESULT IFTPConnection::CopyFile | ( | [in] BSTR | sourceFile, |
| [in] BSTR | destinationFile ) |
| HRESULT IFTPConnection::DeleteFile | ( | [in] BSTR | file | ) |
Deletes a file from the current working directory on the server.
Sends the 'DELE' command. Note that this method does not support full paths; the session must first be navigated to the target directory.
| [in] | file | The filename of the target to be removed (no path information). |
| HRESULT IFTPConnection::Disconnect | ( | ) |
Gracefully disconnects from the remote host.
Initiates a formal shutdown by sending the 'QUIT' command. The client will wait for a server response and a clean socket closure.
| HRESULT IFTPConnection::DownloadFile | ( | [in] BSTR | remoteFile, |
| [in] BSTR | localFile, | ||
| [in] long | startPositionLo, | ||
| [in] long | startPositionHi ) |
Downloads a file from the current working directory on the remote server.
Opens a data connection and issues the 'RETR' command. If a non-zero start position is provided, the 'REST' command is sent first to resume the
transfer from the specified offset.
| [in] | remoteFile | The filename of the remote file in the current directory (no path information). |
| [in] | localFile | The full path to the local file. |
| [in] | startPositionLo | Low-order 32 bits of the 64-bit resume offset. |
| [in] | startPositionHi | High-order 32 bits of the 64-bit resume offset. |
| HRESULT IFTPConnection::DownloadFileEx | ( | [in] BSTR | remoteFile, |
| [in] VARIANT | localFile, | ||
| [in] ULONGLONG | startPosition, | ||
| [in] ULONGLONG | endPosition, | ||
| [in] ITransferProgressEvents * | progress ) |
Downloads a file from the current working directory on the remote server with extended options.
This method functions similarly to DownloadFile but offers greater control over the destination and transfer range.
Flexible Destination: The localFile parameter is a VARIANT that supports multiple types:
Partial Transfers: You can download a specific byte range of a file by setting both startPosition and endPosition. This is useful for:
| [in] | remoteFile | The name of the file to retrieve from the remote server. |
| [in] | localFile | The destination for the data (file path string or IStream object). |
| [in] | startPosition | The 0-based byte offset to start downloading from. |
| [in] | endPosition | The 0-based byte offset to stop downloading at. Pass 0 or 18446744073709551615 (UINT64_MAX) to download until the end of the file. |
| [in] | progress | An optional pointer to an ITransferProgressEvents interface to receive real-time progress updates. |
| HRESULT IFTPConnection::DownloadFromCommand | ( | [in] BSTR | command, |
| [in] VARIANT | localFile, | ||
| [in] long | remoteStartPosLo, | ||
| [in] long | remoteStartPosHi ) |
| HRESULT IFTPConnection::FXPDownloadFile | ( | [in] BSTR | remoteFile, |
| [in] ULONGLONG | startPosition ) |
Initiates a server-to-server (FXP) file transfer from this server.
This method orchestrates the FXP (File eXchange Protocol) download process. The behavior of the method depends heavily on the state of the Passive property.
Control Flow:
| [in] | remoteFile | The name of the file to retrieve from the remote server. |
| [in] | startPosition | The resume offset (byte position). |
| S_OK | Operation initiated successfully (though flow may be paused). |
| FTPLIB_E_PAUSED | The operation is paused waiting for synchronization or the Continue call. |
| FTPLIB_E_MOREDATA | Missing required data (e.g., PassiveAddress in active mode). |
| HRESULT IFTPConnection::FXPUploadFile | ( | [in] BSTR | remoteFile, |
| [in] ULONGLONG | startPosition ) |
Initiates a server-to-server (FXP) file transfer to this server.
This method orchestrates the FXP (File eXchange Protocol) upload process. The behavior of the method depends heavily on the state of the Passive property.
Control Flow:
| [in] | remoteFile | The name of the file to store on the remote server. |
| [in] | startPosition | The resume offset (byte position). |
| S_OK | Operation initiated successfully (though flow may be paused). |
| FTPLIB_E_PAUSED | The operation is paused waiting for synchronization or the Continue call. |
| FTPLIB_E_MOREDATA | Missing required data (e.g., PassiveAddress in active mode). |
| HRESULT IFTPConnection::GetFileHash | ( | [in] HashAlgo | algo, |
| [in] BSTR | file, | ||
| [in] ULONGLONG | start, | ||
| [in] ULONGLONG | length, | ||
| [out, retval] BSTR * | retval ) |
Retrieves the hash value of a file or portion specified with start and length.
Sends a server-specific hash command (e.g., XCRC, XMD5, XSHA1). If both start and length are zero, the command is sent without range parameters, requesting a hash of the entire file.
| [in] | algo | The hashing algorithm to use. |
| [in] | file | The filename of the remote file in the current directory (no path information). |
| [in] | start | Starting offset |
| [in] | length | Number of bytes to hash |
| [out] | retval | A pointer to a BSTR that receives the calculated hash value as a hexadecimal string. |
| HRESULT IFTPConnection::GetFileSize | ( | [in] BSTR | file, |
| [out, retval] ULONGLONG * | retval ) |
Retrieves the size of a specified file on the server.
This method sends the standard SIZE command to the server.
Important Behavior: Before sending the command, this method automatically configures the server's transfer type to match the current DataTransferType property. This is strictly necessary because the result of the SIZE command may vary depending on the mode (e.g., an ASCII text file may report a different size than its binary equivalent due to line-ending conversions).
| [in] | file | The name of the file in the current directory. |
| [out] | retval | A pointer to a 64-bit integer that receives the file size in bytes. |
| HRESULT IFTPConnection::GetFileSize32 | ( | [in] BSTR | file, |
| [out, retval] long * | retval ) |
Retrieves the size of a specified file on the server (for legacy applications).
This method functions identically to GetFileSize. This method returns a 32-bit integer. For modern applications, it is strongly recommended to use GetFileSize (which returns 64-bit values) instead.
| HRESULT IFTPConnection::GetMLST | ( | [in] BSTR | name, |
| [out, retval] IFTPItem ** | retval ) |
| HRESULT IFTPConnection::GetModifyTime | ( | [in] BSTR | file, |
| [out, retval] FILETIME * | retval ) |
Retrieves the last modified time of a specified file on the server.
Because FTP servers vary in their support for file metadata, this method employs a fallback strategy to retrieve the timestamp. It attempts the following commands in order until one succeeds:
| [in] | file | The name of the file in the current directory. |
| [out] | retval | A pointer to a FILETIME structure that receives the last modify time in UTC. |
| HRESULT IFTPConnection::GetModifyTimeAsDate | ( | [in] BSTR | file, |
| [out, retval] VARIANT * | retval ) |
Retrieves the last modified time of a specified file on the remote server.
This method is a convenience wrapper that retrieves the file's modification time and automatically converts it into a VARIANT of type VT_DATE. See GetModifyTime.
| [in] | file | The filename of the remote file in the current directory. |
| [out] | retval | A pointer to a VARIANT structure that receives the date. The resulting variant will have the type VT_DATE. |
| HRESULT IFTPConnection::GetSpaceAvailable | ( | [in] BSTR | path, |
| [out, retval] ISFTPSpaceAvailable ** | retval ) |
Retrieves the available disk space information for a specified path on the server.
This method queries the server for storage statistics by sending the AVBL command.
Command Support: The AVBL command is a non-standard FTP extension. If the server does not explicitly support this command (often found in high-end or specific mainframe FTP implementations), this method will return an error.
| [in] | path | The remote path to query |
| [out] | retval | Receives the ISFTPSpaceAvailable interface pointer. |
| HRESULT IFTPConnection::InitializeTransfer | ( | ) |
Explicitly applies data transfer settings to the server.
This method sends the necessary FTP commands to synchronize the server's state with the client's current configuration. It ensures the server is ready for a transfer by applying the following properties:
| HRESULT IFTPConnection::MakeDirectory | ( | [in] BSTR | directory | ) |
Creates a new directory on the server.
This method sends the standard MKD (Make Directory) command to the server to create a subdirectory in the current working directory.
| [in] | directory | The name of the new directory to create. |
| HRESULT IFTPConnection::NewFile | ( | [in] BSTR | file | ) |
Creates a new, empty (zero-byte) file on the remote server.
This method opens a data connection and immediately closes it without sending data, effectively creating an empty file using the standard STOR command.
| [in] | file | The name of the file to create in the current directory. |
| HRESULT IFTPConnection::ReadDirectory | ( | [out, retval] IFTPItems ** | retval | ) |
Retrieves the contents of the current working directory on the server.
This method initiates a data transfer to list the files and subdirectories in the current location.
Command Strategy:
| [out] | retval | A pointer to an IFTPItems collection interface that receives the directory listing. |
| HRESULT IFTPConnection::ReadDirectoryEx | ( | [in] ITransferProgressEvents * | progress, |
| [out, retval] IFTPItems ** | retval ) |
| HRESULT IFTPConnection::ReadDirectoryFromCommand | ( | [in] BSTR | command, |
| [out, retval] IFTPItems ** | retval ) |
| HRESULT IFTPConnection::ReadDirectoryRaw | ( | [in] VARIANT | localFile | ) |
Downloads the raw directory listing from the server to a local file.
This method executes a directory listing command (LIST or MLSD) and streams the server's response directly to a file on the local filesystem.
Use Case: This is primarily useful for:
| [in] | localFile | The full path to the local file where the raw listing will be saved. |
| HRESULT IFTPConnection::RemoveDirectory | ( | [in] BSTR | directory | ) |
Removes a directory from the server.
This method sends the standard RMD (Remove Directory) command to delete the specified directory.
| [in] | directory | The name (or relative path) of the directory to remove. |
| HRESULT IFTPConnection::RenameDirectory | ( | [in] BSTR | directoryFrom, |
| [in] BSTR | directoryTo ) |
Renames or moves a directory on the server.
This method executes the standard two-step FTP rename sequence:
Move Capability: You can move a directory to a new location by specifying a relative or absolute path in the directoryTo parameter (e.g., renaming "Photos" to "../Archive/Photos").
| [in] | directoryFrom | The current name (or path) of the directory. |
| [in] | directoryTo | The new name (or path) for the directory. |
| HRESULT IFTPConnection::RenameFile | ( | [in] BSTR | fileFrom, |
| [in] BSTR | fileTo ) |
Renames or moves a file on the server.
This method executes the standard two-step FTP rename sequence:
Move Capability: You can move a file to a new location by specifying a relative or absolute path in the fileTo parameter (e.g., renaming "photo.jpg" to "../Archive/photo.jpg").
| [in] | fileFrom | The current name (or path) of the file. |
| [in] | fileTo | The new name (or path) for the file. |
| HRESULT IFTPConnection::SetCreateTime | ( | [in] BSTR | file, |
| [in] FILETIME | time ) |
Sets the creation timestamp of a file on the remote server.
This method attempts to change the file's metadata using the MFCT or MFF (Modify Fact) command.
Server Support: This operation relies on the server supporting the MFCT or MFF extension (draft-somers-ftp-mfxx-04).
| [in] | file | The name of the remote file. |
| [in] | time | The new creation timestamp in UTC format. |
| HRESULT IFTPConnection::SetCreateTimeAsDate | ( | [in] BSTR | file, |
| [in] VARIANT | date ) |
Sets the creation timestamp of a file using an OLE Automation Date.
This method is a convenience wrapper for SetCreateTime. It accepts a date in VARIANT format (specifically VT_DATE).
Target Audience: This method is designed for scripting environments (such as VBScript, classic ASP, or PowerShell) where constructing a raw C++ FILETIME structure is difficult or impossible.
| [in] | file | The name of the remote file in the current directory. |
| [in] | date | The new creation timestamp as a VARIANT (must be of type VT_DATE). |
| HRESULT IFTPConnection::SetFileLogger | ( | [out, retval] IFileLogger ** | fileLogger | ) |
Creates a file logger sfFTPLib::FileLogger and attaches it to the Logger property.
Warning: * Calling this method a second time will detach and destroy the previous logger, replacing it with a new, unconfigured instance.
Typical Usage Workflow:
| [out] | fileLogger | Receives the pointer to the newly created and attached IFileLogger interface. |
| HRESULT IFTPConnection::SetModifyTime | ( | [in] BSTR | file, |
| [in] FILETIME | time ) |
Sets the modification timestamp of a file on the remote server.
This method attempts to change the file's metadata using the MFMT or MFF (Modify Fact) command.
Server Support: This operation relies on the server supporting the MFMT or MFF extension (draft-somers-ftp-mfxx-04).
| [in] | file | The name of the remote file. |
| [in] | time | The new modification timestamp in UTC format. |
| HRESULT IFTPConnection::SetModifyTimeAsDate | ( | [in] BSTR | file, |
| [in] VARIANT | date ) |
Sets the modification timestamp of a file using an OLE Automation Date.
This method is a convenience wrapper for SetModifyTime. It accepts a date in VARIANT format (specifically VT_DATE).
Target Audience: This method is designed for scripting environments (such as VBScript, classic ASP, or PowerShell) where constructing a raw C++ FILETIME structure is difficult or impossible.
| [in] | file | The name of the remote file in the current directory. |
| [in] | date | The new modification timestamp as a VARIANT (must be of type VT_DATE). |
| HRESULT IFTPConnection::SetUnixPermissions | ( | [in] BSTR | name, |
| [in] long | permissions ) |
Sets the Unix permissions (mode) of a remote file or directory.
This method attempts to change the access permissions of the specified item using the standard Unix permission bits.
Command Strategy: It attempts the following commands to apply the permissions:
If the server supports neither command, the operation fails.
| [in] | name | The name of the remote file or directory. |
| [in] | permissions | The new Unix permission bits (e.g., 0644). |
| HRESULT IFTPConnection::Stat | ( | [in] BSTR | name, |
| [out, retval] IFTPItems ** | retval ) |
Retrieves file status or a directory listing using the control connection.
This method sends the STAT command with the specified argument.
| HRESULT IFTPConnection::UpdateWorkingDirectory | ( | ) |
Synchronizes the local WorkingDirectory property with the server.
This method sends the standard PWD (Print Working Directory) command to the server and updates the library's internal state with the result.
Use Case: Call this method to verify the current location if you suspect the client and server have become out of sync (e.g., after a failed navigation command, a complex script, or a server-side timeout).
| HRESULT IFTPConnection::UploadFile | ( | [in] BSTR | localFile, |
| [in] BSTR | remoteFile, | ||
| [in] long | startPositionLo, | ||
| [in] long | startPositionHi ) |
Uploads a local file to the current working directory on the remote server.
This method opens a data connection and transfers the file content using the standard STOR (Store) command.
Resuming Transfers: If a non-zero start position is provided (via startPositionLo and startPositionHi), the method first sends the REST (Restart) command. This instructs the server to begin writing data at the specified offset, effectively resuming a broken transfer.
| [in] | localFile | The full path to the local file to be uploaded. |
| [in] | remoteFile | The name to store the file as on the remote server. |
| [in] | startPositionLo | The low-order 32 bits of the 64-bit resume offset. |
| [in] | startPositionHi | The high-order 32 bits of the 64-bit resume offset. (Combine these to specify the byte offset to restart a broken transfer). |
| HRESULT IFTPConnection::UploadFileEx | ( | [in] VARIANT | localFile, |
| [in] BSTR | remoteFile, | ||
| [in] ULONGLONG | startPosition, | ||
| [in] ITransferProgressEvents * | progress ) |
Uploads a file or stream to the remote server with extended options.
This method provides an advanced interface for transferring data to the server, supporting both local filesystem sources and in-memory streams.
Flexible Source: The localFile parameter is a VARIANT that supports multiple types:
Resuming Transfers: If startPosition is non-zero, the method sends the REST (Restart) command before the STOR command. This allows the server to append or overwrite data starting at the specified byte offset, facilitating the resumption of interrupted uploads.
| [in] | localFile | The source of the data (a full file path string or an IStream object). |
| [in] | remoteFile | The name to be used for the file on the remote server. |
| [in] | startPosition | The 64-bit byte offset at which to start the upload on the server. |
| [in] | progress | An optional pointer to an ITransferProgressEvents interface to receive real-time callbacks regarding the transfer's status and byte count. |
|
getproperty |
Indicates whether the last operation was explicitly cancelled by the user.
The Context: Long-running operations like DownloadFile, or UploadFile can be interrupted using the Abort method.
The Mechanism:
Usage: This property is essential for error handling logic. It allows you to distinguish between "The network crashed" (Error) and "The user clicked Cancel" (Not an Error).
| [out] | retval | Receives VARIANT_TRUE if aborted; VARIANT_FALSE otherwise. |
|
getsetproperty |
Gets or sets the account information used for the ACCT command.
The Role: Some FTP servers (particularly mainframes, VMS, or systems with strict billing/accounting) require an additional ACCT command during the login sequence to authorize the session or allocate resources.
Automatic Handling: The component monitors the server's response to the PASS command.
Common Scenarios:
| [in] | newValue | The account string (e.g., a project ID, billing code, or secondary password). |
| [out] | retval | Receives the current account string. |
|
getproperty |
Indicates whether the connection is currently executing an operation.
|
getsetproperty |
Gets or sets the client identification information sent to the server via the CSID and CLNT commands.
The Context (CSID and CLNT): The FTP protocol has seen various extensions implemented by different vendors to allow a client to identify itself.
The Mechanism: This property accepts a pointer to an IFTPClientId object. The component uses the data in this object to automatically issue the appropriate identification command (CSID, CLNT, or both) based on the server's reported capabilities.
Usage: Identifying your client application allows server administrators to track usage stats and enables the server to apply specific compatibility workarounds if it detects a known client version.
| [in] | newValue | A pointer to an IFTPClientId interface containing the application's identity. |
| [out] | retval | Receives the current IFTPClientId interface pointer. |
|
getsetproperty |
|
getsetproperty |
|
getsetproperty |
Controls the aggressiveness of the zlib compression algorithm.
This property tunes the balance between data size reduction and CPU usage.
Range: * - 1 (Fastest): Minimal compression, lowest CPU overhead. Ideal for fast networks.
| [in] | newValue | An integer between 1 and 9. |
| [out] | retval | Receives the current compression level. |
|
getproperty |
Retrieves the current state of the SSH connection.
This property allows you to check if the client is currently connected, connecting, or disconnected.
| [out] | retval | Receives the ConnectionStatus enumeration value. |
|
getsetproperty |
|
getsetproperty |
Gets or sets the transmission mode (Stream, Block, or Compressed) used for data transfer.
The Mechanism: This property controls the structure of the data sent over the data connection. It maps directly to the FTP MODE command.
| [in] | newValue | A value from the DataTransferMode enumeration. |
| [out] | retval | Receives the current mode. |
|
getsetproperty |
Sets a maximum bandwidth limit for data transfers.
The Mechanism: This property artificially throttles the speed of file uploads and downloads by pausing the data stream at regular intervals.
Value:
| [in] | newValue | The maximum speed in bytes/second. Set to 0 to disable throttling. |
| [out] | retval | Receives the current speed limit setting. |
|
getsetproperty |
Gets or sets the transfer mode (ASCII vs. Binary) for file operations.
The Mechanism: FTP supports two primary transfer modes that determine how bytes are handled during transit.
| [in] | newValue | A value from the DataTransferType enumeration. |
| [out] | retval | Receives the current transfer type. |
|
getsetproperty |
Configures when the FEAT command is sent to discover server capabilities.
The Context (Capability Discovery): Modern FTP is highly extensible. The FEAT command allows the client to ask: "What extra features do you support besides basic file transfer?"
Default Value: ftpFeatureDiscoveryModeAfterLogin (1). Compatibility Note: The default is set to "After Login" because many firewalls, NAT routers with "FTP Inspection" enabled, and security proxies view the FEAT command as an unauthorized probe if sent before authentication. Sending it too early can cause these devices to terminate the connection.
Virtual Hosting & The HOST Command:
Impact on Workflow: The results of the FEAT command are used internally to automatically enable features like MLSD or UTF8 path encoding.
| [in] | newValue | The FeatureDiscoveryMode enum value. |
| [out] | retval | Receives the current FEAT negotiation setting. |
|
getsetproperty |
Sets the size of the internal memory buffer used for local file I/O operations.
The Mechanism: When uploading or downloading files, the component moves data between the Network Socket and the Local Disk. This property controls the size of the data chunk handled in each disk interaction.
Performance Tuning: Larger buffer sizes reduce the number of disk I/O interrupts (context switches), which can significantly improve performance on high-speed networks (1Gbps+) or when writing to high-latency storage (e.g., network shares or mechanical drives).
Constraints:
| [in] | newValue | The buffer size in bytes. Must be at least 32768. |
| [out] | retval | Receives the current buffer size setting. |
|
getsetproperty |
Controls whether the password is masked in the component's log output.
The Context: When the component connects to an FTP server, it sends the PASS command containing the user's password. If logging is enabled (via Logger or similar mechanisms), this command is recorded in the log file.
The Solution:
Default Value: VARIANT_FALSE (Disabled). By default, passwords are visible in logs to aid in initial debugging.
Security Best Practice: Always keep this property enabled in production environments. Disable it only temporarily if you are debugging a specific authentication issue and need to verify exactly what characters are being sent to the server.
| [in] | newValue | VARIANT_TRUE to mask the password; VARIANT_FALSE to reveal it. |
| [out] | retval | Receives the current setting. |
|
getsetproperty |
Specifies the destination server address.
| [in] | newValue | The hostname or IP address string. |
| [out] | retval | Receives the current host setting. |
|
getsetproperty |
Enables automatic "keep-alive" packets to prevent connection timeouts during inactivity.
The Problem: TCP connections, especially those traversing NAT routers and firewalls, are often dropped if no data flows for a certain period (e.g., 5-10 minutes). FTP servers also have "Idle Timeout" settings (often 300-900 seconds) that disconnect silent clients to save resources.
The Solution: When set to VARIANT_TRUE, the component automatically sends a lightweight command NOOP to the server at regular intervals if no other commands are being executed.
Default Value: VARIANT_FALSE (Disabled). By default, the component remains silent when idle.
| [in] | newValue | VARIANT_TRUE to enable keep-alive packets; VARIANT_FALSE to disable them. |
| [out] | retval | Receives the current setting. |
|
getsetproperty |
Sets the time interval (in seconds) between automatic keep-alive packets.
The Mechanism: This property controls the frequency of the NOOP commands sent by both IdleKeepAlive and TransferKeepAlive.
Tuning Guide:
Default Value: 30 seconds.
| [in] | newValue | The interval in seconds. |
| [out] | retval | Receives the current interval setting. |
|
getproperty |
Retrieves the raw text of the most recent FTP command sent to the server.
This property stores the last command string exactly as it was written to the socket.
Security Note: If the last command was PASS (sending a password), this property will return the password in plain text unless internal masking is active. Treat the output of this property as sensitive data.
| [out] | retval | Receives the command string (e.g., "SIZE file.png"). |
|
getproperty |
Retrieves the specific error code encountered on the Data Channel socket.
The Context (Dual Channels): FTP uses two distinct connections:
The Problem: A command might succeed on the Control Channel (e.g., Server says "150 Opening data connection"), but the Data Channel might fail due to a firewall block, a TLS handshake failure, or a timeout. In this scenario, the main command error might be generic, obscuring the root cause.
The Solution: LastDataConnectionError captures the specific error code from the ephemeral data socket.
Usage: Check this property if a transfer fails but LastReplyCode indicates a preliminary success (1xx) or if LastError is vague. It is invaluable for debugging Passive/Active mode mismatches and FTPS certificate issues.
| [out] | retval | Receives the HRESULT code. |
|
getproperty |
Retrieves the HRESULT error code of the most recent operation.
The Context: When you call methods on the IFTPConnection interface (e.g., Connect, DownloadFile), they return an HRESULT indicating success or failure.
The Mechanism: This property stores that return value internally. It allows you to check the status of the last operation at a later time, or from a different part of your code (e.g., in a centralized error handler).
Reset Behavior: The value is overwritten by every new method call. It is not automatically reset to S_OK unless a new operation succeeds.
| [out] | retval | Receives the HRESULT code (e.g., 0 for success, non-zero for failure). |
|
getproperty |
Retrieves the raw text response received from the FTP server for the most recent command.
The Context: Every action you perform (connecting, downloading, listing files) involves sending a command to the server. The server responds with a status code and a human-readable message.
The Mechanism: This property automatically updates after every single interaction with the server. It contains the full text of the last response line (including the numeric code).
Usage:
Format: Standard FTP responses follow the format: [3-digit Code] [Text Message].
| [out] | retval | Receives the raw response string (e.g., "226 Transfer complete."). |
|
getproperty |
Retrieves the numeric status code returned by the FTP server for the most recent command.
The Context: Every FTP server response begins with a 3-digit number indicating the result of the operation. This property parses that number from the raw response string.
The Mechanism: If the server responds with 226 Transfer complete., this property returns 226.
| [out] | retval | Receives the 3-digit status code (e.g., 200, 550). Returns 0 if no command has been executed. |
|
getproperty |
Retrieves the total number of bytes transferred during the last SFTP transfer.
The Scope: This value represents the payload size successfully sent or received in the most recent file transfer (upload or download) or directory listing. It resets at the start of each new transfer.
| [out] | retval | Receives the number of bytes transferred. |
|
getproperty |
Retrieves the upper 32 bits of the last transfer size.
Legacy Support: This property is provided for languages or environments (like VB6) It represents the LastTransferBytes >> 32.
Calculation: To reconstruct the full 64-bit value manually: (High * 2^32) + Low.
| [out] | retval | Receives the high-order double word of the byte count. |
|
getproperty |
Retrieves the lower 32 bits of the last transfer size.
Legacy Support: This property is provided for languages or environments (like VB6) that do not natively support 64-bit integers. It represents the LastTransferBytes & 0xFFFFFFFF.
| [out] | retval | Receives the low-order double word of the byte count. |
|
getproperty |
Retrieves the average data transfer rate of the last FTP transfer.
The Calculation: This value is derived automatically from LastTransferBytes and LastTransferTime. It represents the average speed over the entire duration of the operation.
Speed = LastTransferBytes / (LastTransferTime / 1000)
Edge Cases: If the transfer time was effectively zero (e.g., extremely small files < 1KB), this property returns 0 to avoid division-by-zero errors.
| [out] | retval | Receives the transfer speed in Bytes per second. |
|
getproperty |
Retrieves the duration of the last FTP transfer in milliseconds.
The Measurement: This value represents the elapsed wall-clock time from the start of the request to the receipt of the final response (or error). It applies to file transfers (upload/download), and directory listings.
| [out] | retval | Receives the elapsed time in milliseconds (e.g., 1500 for 1.5 seconds). |
|
getsetproperty |
Enables the use of a specific pool of local ports for data connections.
The Problem: In Active Mode (Passive = FALSE), the client opens a local port and waits for the server to connect to it. By default, the OS assigns a random port (ephemeral port).
The Solution: Setting this property to VARIANT_TRUE instructs the component to request a port number from the global sfFTPLib::FTPPortPool singleton (specifically calling IFTPPortPool::NextPort).
Usage Workflow:
Effect: The component will cycle through the defined ports for each data transfer, allowing you to maintain a strict firewall policy.
| [in] | newValue | VARIANT_TRUE to engage the Port Pool; VARIANT_FALSE to let the OS choose random ports. |
| [out] | retval | Receives the current setting. |
|
getsetproperty |
Gets or sets the flags used for the FTP LIST command.
The Mechanism: This property defines a bitmask of LISTOption values. When a directory listing is requested, the component converts these flags into a command-line argument string (e.g., "-la") and appends it to the LIST command sent to the FTP server.
Modern Alternatives (MLST/MLSD): Most modern FTP servers support RFC 3659 extensions, specifically the MLST and MLSD commands. These commands provide a standardized, machine-parsable format that removes the need for "dash" arguments. This LISTOption property is only relevant when the component falls back to the legacy LIST command.
Default Value: 0 (None). By default, no options are sent with the LIST command.
RFC 959 Compliance: This property is disabled by default because "dash" arguments (like -l or -a) are not part of the formal RFC 959 specification.
| [in] | newValue | A bitmask of LISTOption flags. |
| [out] | retval | Receives the current bitmask of LISTOption flags. |
|
setproperty |
Attaches a logging mechanism to the FTP session for debugging and auditing.
This property allows you to capture the internal activity of the component. By assigning an object that implements the ILogger interface, you can redirect log messages to a file, the console, or a custom monitoring system.
| [in] | logger | A pointer to an ILogger implementation. Set to NULL to disable logging. |
|
getsetproperty |
Controls whether the component automatically performs the USER/PASS authentication sequence upon connection.
The Mechanism: When the Connect method is called, the component establishes the TCP/IP connection (and TLS handshake if using FTPS).
Default Value: VARIANT_TRUE (Enabled). Most applications want to authenticate immediately.
| [in] | newValue | Set to VARIANT_TRUE to auto-login; VARIANT_FALSE to connect without logging in. |
| [out] | retval | Receives the current setting. |
|
getsetproperty |
Controls whether the data connection is established in Passive (PASV) or Active (PORT) mode.
The Mechanism: FTP requires two channels: a Control Channel (port 21) and a Data Channel (for file transfers and directory listings). This property determines who initiates the Data Channel connection.
Default Value: VARIANT_TRUE (Enabled). By default, the component uses Passive mode. This is the standard configuration for modern internet usage, as it works seamlessly behind client-side NAT routers and firewalls.
Modes:
| [in] | newValue | Set to VARIANT_TRUE for Passive mode; VARIANT_FALSE for Active mode. |
| [out] | retval | Receives the current mode setting. |
|
getsetproperty |
Specifies or retrieves the IP address used for Server-to-Server (FXP) data connections.
The Context (FXP): In a Server-to-Server transfer, one server acts as the "Passive" partner (listening for a connection) and the other acts as the "Active" partner (initiating the connection).
The Mechanism: This property acts as the bridge for the IP address between the two connections.
| [in] | newValue | The IP address string to be used in the PORT command. |
| [out] | retval | Receives the IP address obtained from the last PASV reply. |
|
getsetproperty |
Controls how the client determines the target IP address for Passive Mode data connections.
The Problem (Server-Side NAT): When an FTP server is behind a NAT (e.g., AWS EC2, Azure VM, or corporate firewall), it often doesn't know its public IP address.
The Solution: This property tells the component whether to trust the server's reply or to ignore it and force the connection to the original host IP (203.0.113.5).
Default Value: ftpPassiveModeAuto (3).
**Relationship to Passive Property:** This property only applies when Passive is set to TRUE. If Passive is FALSE (Active Mode), this setting is ignored.
| [in] | newValue | A value from the PassiveMode enumeration. |
| [out] | retval | Receives the current setting. |
|
getsetproperty |
Gets or sets the password used for authentication.
The Role: This property holds the secret credential associated with the Username.
Protocol Behavior: The value is sent via the PASS command immediately after the server accepts the USER command.
Security Note:
| [in] | newValue | The password string. |
| [out] | retval | Receives the current password. |
|
getproperty |
Retrieves the IP address of the currently connected remote server.
The Context: When you connect to an FTP server using a domain name (e.g., ftp.example.com), the DNS system resolves this name to an IP address.
The Usage: This property allows you to see exactly which IP address the component is talking to.
Timing: This property returns a valid string only after a successful connection is established. If not connected, it returns an empty string.
| [out] | retval | Receives the IP address string (e.g., "203.0.113.5"). |
|
getsetproperty |
Specifies the TCP port number to connect to.
This property defines the listening port on the remote server.
Defaults:
| [in] | newValue | The port number (default: 21). |
| [out] | retval | Receives the current port setting. |
|
getsetproperty |
Specifies the IP address sent to the server during Active Mode (PORT) negotiations.
The Role: In Active Mode, the client tells the server: "Connect to me at IP address X." This property defines "IP address X."
When to Use: This property is only used when:
Format: Expects a standard IPv4 address string (e.g., "203.0.113.10"). If left empty, the component falls back to using the local machine's IP.
| [in] | newValue | The public IP address string. |
| [out] | retval | Receives the current IP setting. |
|
getsetproperty |
Controls how the client determines the IP address sent in the PORT command (Active Mode).
The Problem (Client-Side NAT): In Active Mode (Passive = FALSE), the client must send its IP address to the server so the server can connect back to it.
The Solution: This property determines whether the component sends the local machine's IP or a custom override provided in the PortIP property.
Prerequisites:
Default Value: ftpPortModeDefault (1).
| [in] | newValue | A value from the PortMode enumeration. |
| [out] | retval | Receives the current setting. |
|
getsetproperty |
Controls whether the client falls back to an unencrypted data channel if encrypted data transfer (PROT P) fails.
The Context (PROT Command): In an FTPS session, the PROT (Protection Level) command determines if file contents and directory listings are encrypted.
The Mechanism: When the connection uses a secure protocol (e.g., ftpProtocolRequireTLS), the component defaults to attempting PROT P to ensure maximum security for your files.
Values:
Security Warning: The default value (TRUE) prioritizes connectivity. However, if a fallback occurs, your file data will be visible to network sniffers, even though your password (sent on the Control Channel) remains encrypted.
| [in] | newValue | Set to VARIANT_TRUE to allow fallback to cleartext; VARIANT_FALSE to enforce strict encryption. |
| [out] | retval | Receives the current fallback setting. |
|
getsetproperty |
Gets or sets the security protocol used for the connection.
The Mechanism: This property dictates the initial handshake behavior when Connect is called. It determines the default port (if not explicitly set) and whether the component attempts to negotiate an encrypted TLS session.
Default Value: The default setting is ftpProtocolPreferTLS.
| [in] | newValue | A value from the FTPProtocol enumeration. |
| [out] | retval | Receives the current protocol setting. |
|
getproperty |
Retrieves the network protocol family (IPv4 or IPv6) used for the active connection.
This property indicates whether the underlying TCP connection was established using Internet Protocol version 4 or version 6.
| [out] | retval | Receives the ProtocolFamily enumeration value. |
|
getsetproperty |
Controls the preference for IPv4 or IPv6 during hostname resolution.
This property determines which network protocol stack the client attempts to use when the Host property contains a domain name (e.g., "ftp.example.com") that resolves to multiple IP addresses.
| [in] | newValue | The ProtocolFamily value to enforce. |
| [out] | retval | Receives the current preference setting. |
|
getproperty |
Accesses the proxy configuration settings for the connection.
This property returns the IProxySettings interface, which allows you to define how the SSH connection should be routed through an intermediate server.
| [out] | retval | Receives the IProxySettings interface pointer. |
|
getproperty |
Retrieves the interface used to inspect the current state of the server session.
The Role: While the main IFTPConnection interface controls the desired configuration (what you want to happen), the IFTPServerState interface reports the actual status (what has happened).
| [out] | retval | Receives the pointer to the IFTPServerState interface. |
|
getproperty |
Accesses the low-level TCP socket configuration.
This property returns the ISocketSettings interface, which allows you to fine-tune the underlying network socket behavior before or during a connection.
| [out] | retval | Receives the ISocketSettings interface pointer. |
|
getproperty |
Accesses the bandwidth throttling configuration for this specific connection.
This property returns the ISpeedLimitSettings interface, which allows you to restrict the maximum upload and download rates for this SSH session.
| [out] | retval | Receives the ISpeedLimitSettings interface pointer. |
|
getsetproperty |
Enables or disables the sending of the SSCN command for secure FXP transfers.
The Problem (Secure FXP): When transferring files directly between two FTP servers (FXP) using FTPS (SSL/TLS), a security mechanism called TLS Session Resumption often causes failures.
The Solution: Setting this property to VARIANT_TRUE instructs the component to send the SSCN ON command to the server before the transfer begins.
| [in] | newValue | VARIANT_TRUE to send SSCN ON; VARIANT_FALSE (Default) to disable it. |
| [out] | retval | Receives the current setting. |
|
getproperty |
Retrieves the underlying TLS socket object used for secure communication.
The Architecture: The FTP component is built on top of a specialized socket interface (ITlsSocket) that handles all TCP and TLS operations.
| [out] | retval | Receives the pointer to the ITlsSocket interface. |
|
getsetproperty |
Sets the maximum time (in seconds) to wait for a network operation to complete.
This property defines the timeout threshold for all blocking calls, such as connecting, reading data, or waiting for a server response. If an operation exceeds this duration, it is aborted and returns an error.
Default:
| [in] | newValue | The timeout duration in seconds. |
| [out] | retval | Receives the current timeout setting. |
|
getsetproperty |
Enables the sending of NOOP commands on the Control Channel during active file transfers.
The Problem (The "Hanging" Transfer): FTP uses two separate connections: a Control Channel (commands) and a Data Channel (file contents).
The Solution: When set to VARIANT_TRUE, the component periodically sends a NOOP command on the Control Channel while the data is still flowing on the Data Channel.
Important Note: While effective, sending commands during a transfer technically violates strict FTP protocol (which expects the client to wait). However, most modern servers handle this gracefully by ignoring the NOOP or queuing the response until the transfer finishes.
Default Value: VARIANT_FALSE (Disabled).
| [in] | newValue | VARIANT_TRUE to enable NOOP injection; VARIANT_FALSE to disable. |
| [out] | retval | Receives the current setting. |
|
getsetproperty |
Controls whether the component processes Windows messages during blocking operations.
This property determines how the library behaves while waiting for a network response.
Settings:
When to use TRUE: Enable this if you are using the component on the Main UI Thread of a desktop application (VB6, VBA, Delphi, WinForms) and want to keep the window responsive.
When to use FALSE: Keep this disabled for Console apps, Windows Services, or background worker threads where no UI interaction exists.
| [in] | newValue | Set to VARIANT_TRUE to enable message pumping; VARIANT_FALSE to disable it. |
| [out] | retval | Receives the current setting. |
|
getsetproperty |
Controls whether the component uses the MLSD command if supported by the server.
The Mechanism: Modern FTP servers support the RFC 3659 extension, which introduces the MLST (for single file) and MLSD (for directories) commands. Unlike the legacy LIST command, which returns unformatted text that must be guessed/parsed, MLST and MLSD return standardized, machine-readable metadata (facts).
Default Value: VARIANT_TRUE (Enabled). The component will automatically attempt to use these modern commands if the server advertises support in its FEAT (Features) response.
Benefits of Enabling (TRUE):
When to Disable (FALSE): You might set this to VARIANT_FALSE if a specific server has a buggy or non-standard implementation of RFC 3659 that causes listings to fail or return incomplete data. When disabled, the component falls back to the legacy LIST command.
| [in] | newValue | Set to VARIANT_TRUE to prefer modern listing commands; VARIANT_FALSE to force legacy LIST. |
| [out] | retval | Receives the current setting. |
|
getsetproperty |
Gets or sets the username used for authentication.
The Role: This property identifies the user account on the remote FTP server. It is the first credential sent during the login sequence.
Protocol Behavior: The value provided here is sent via the standard USER command immediately after the control connection is established.
Formatting:
| [in] | newValue | The username string. |
| [out] | retval | Receives the current username. |
|
getproperty |
Retrieves the current remote working directory.
This property tracks the directory path where the session is currently located on the server.
| [out] | retval | Pointer to a BSTR that receives the current absolute path. |