Ftp2 Delphi DLL Reference Documentation

Ftp2

Current Version: 11.5.0

Chilkat.Ftp2

Connect, secure, transfer, synchronize, and manage files on FTP servers.

Chilkat.Ftp2 is a comprehensive FTP and FTPS client class for applications that need reliable file transfer and remote file management. It supports connection setup, explicit and implicit TLS, passive and active data connections, uploads, downloads, directory listings, recursive operations, synchronization, proxy traversal, credential protection, and detailed diagnostics.

FTP and FTPS connections

Connect using plain FTP, explicit TLS, or implicit TLS, with control over ports, timeouts, passive mode, and IPv4/IPv6 behavior.

Upload and download files

Transfer files, text, binary data, streams, and in-memory content, with support for resume, append, and progress monitoring.

Remote file management

List directories, create and remove folders, rename files, delete files, inspect sizes and timestamps, and manage remote paths.

Recursive and sync operations

Upload or download directory trees, mirror folders, and synchronize local and remote content.

Security and credentials

Use TLS options, client certificates, secure password handling, and secret-backed credential references where appropriate.

Diagnostics and TLS details

Use LastErrorText, session logs, directory listings, and TLS negotiation details to troubleshoot server behavior.

Tip: For FTPS troubleshooting, inspect the detailed diagnostic output and, when available, the last JSON data describing the TLS negotiation, certificate validation, protocol version, and related connection details.

Create/Dispose

var
myObject: HCkFtp2;

begin
myObject := CkFtp2_Create();

// ...

CkFtp2_Dispose(myObject);
end;
function CkFtp2_Create: HCkFtp2; stdcall;

Creates an instance of the HCkFtp2 object and returns a handle (i.e. a Pointer). The handle is passed in the 1st argument for the functions listed on this page.

procedure CkFtp2_Dispose(handle: HCkFtp2); stdcall;

Objects created by calling CkFtp2_Create must be freed by calling this method. A memory leak occurs if a handle is not disposed by calling this function.

Properties

AbortCurrent
function CkFtp2_getAbortCurrent(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putAbortCurrent(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;
Introduced in version 9.5.0.58

Set to True to request cancellation of the operation currently running on this object. Long-running network and file-transfer methods periodically check this property; methods that complete quickly may finish before the request is observed.

A synchronous call can be cancelled from another thread by setting this property on the same object. The property is reset to False after cancellation is processed, and a stale request is cleared when a later method begins.

Cancellation behavior: Treat this as a cancellation request, not a guarantee of immediate termination. Use the method's normal return value and diagnostic properties to determine the outcome.

top
Account
procedure CkFtp2_getAccount(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putAccount(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__account(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the FTP account string sent with the ACCT command when a server requires an account in addition to the username and password. Most FTP servers do not require this value, so leave it empty unless the server administrator or login instructions explicitly provide an account name.

See the notes about PWideChar memory ownership and validity.

top
ActivePortRangeEnd
function CkFtp2_getActivePortRangeEnd(objHandle: HCkFtp2): Integer; stdcall;
procedure CkFtp2_putActivePortRangeEnd(objHandle: HCkFtp2; newPropVal: Integer); stdcall;

Specifies the last local TCP port that may be used for active-mode data connections. Use this property together with ActivePortRangeStart to define the allowed range.

Each FTP directory listing, upload, and download uses a separate data connection. In active mode, the client chooses a port in this range and advertises it to the server with PORT or EPRT.

Firewall requirement: The entire configured range must be permitted by the client-side firewall and any intervening network address translation. Passive mode is usually easier when the client is behind NAT.

top
ActivePortRangeStart
function CkFtp2_getActivePortRangeStart(objHandle: HCkFtp2): Integer; stdcall;
procedure CkFtp2_putActivePortRangeStart(objHandle: HCkFtp2; newPropVal: Integer); stdcall;

Specifies the first local TCP port that may be used for active-mode data connections. Use this property together with ActivePortRangeEnd to restrict the listener ports opened by the FTP client.

Active FTP: In active mode, the client opens a listening socket and tells the server where to connect. A fixed range can simplify local firewall rules, but the selected ports must be reachable from the FTP server.

top
AllocateSize
function CkFtp2_getAllocateSize(objHandle: HCkFtp2): LongWord; stdcall;
procedure CkFtp2_putAllocateSize(objHandle: HCkFtp2; newPropVal: LongWord); stdcall;

Specifies the size, in bytes, to send in an ALLO command before an upload. The default value of 0 disables the command.

ALLO asks the server to reserve storage for the incoming file. Most modern servers do not require it and may ignore it, but some specialized or quota-managed servers require the allocation request before accepting the transfer.

top
AllowMlsd
function CkFtp2_getAllowMlsd(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putAllowMlsd(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;
Introduced in version 9.5.0.50

Controls whether machine-readable directory listings are requested with MLSD when the server advertises support. The default is True.

MLSD returns standardized facts such as type, size, and modification time, making it more reliable than parsing the server-specific text produced by LIST. When MLSD is used, GetPermissions returns the server's perm fact rather than a UNIX-style permission string.

Recommended setting: Keep this property enabled unless a particular server has a broken MLSD implementation. Disabling it can reduce the accuracy or availability of timestamps, sizes, and other listing information.

More Information and Examples
top
AuthSsl
function CkFtp2_getAuthSsl(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putAuthSsl(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;

Set to True to request explicit FTPS by sending AUTH SSL after the initial unencrypted FTP connection is established. Set this property before calling Connect.

AUTH SSL is a legacy alternative to AUTH TLS. Use AuthTls for normal explicit FTPS unless the server specifically requires AUTH SSL. Do not also enable Ssl, which selects implicit FTPS.

More Information and Examples
top
AuthTls
function CkFtp2_getAuthTls(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putAuthTls(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;

Set to True to use explicit FTP over TLS. The client first connects using ordinary FTP, normally on port 21, and then sends AUTH TLS to protect the control connection. Set this property before calling Connect and leave Ssl set to False.

The protection applied to data connections is controlled by DataProtection; its default behavior is to protect data connections when the control connection is protected.

FTPS terminology: Explicit FTPS upgrades an existing FTP connection with AUTH TLS. It is different from SFTP, which is a file-transfer protocol carried by SSH.

top
AutoFeat
function CkFtp2_getAutoFeat(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putAutoFeat(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;

Controls whether a FEAT command is sent automatically after connecting. The default is True. The response allows Chilkat to detect capabilities such as MLSD, UTF8, EPSV, and server-specific extensions.

Set to False only for a server that mishandles FEAT. A conforming server that does not implement the command should simply return an error reply without closing the session.

top
AutoFix
function CkFtp2_getAutoFix(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putAutoFix(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;

Controls automatic correction of common FTPS settings based on Port. The default is True. Before connecting:

PortAutomatic adjustment
990Sets Ssl to True and sets AuthTls and AuthSsl to False.
21Sets Ssl to False so explicit FTPS may be used.
Purpose: This prevents contradictory implicit- and explicit-FTPS settings. Disable it only when the server uses a nonstandard port and the application must preserve an explicitly configured combination.

top
AutoGetSizeForProgress
function CkFtp2_getAutoGetSizeForProgress(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putAutoGetSizeForProgress(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;

Controls whether Chilkat requests the remote file size before each download so percentage-based progress can be calculated. The default is False.

Enable this when the server's transfer reply does not provide a usable size and accurate PercentDoneScale callbacks are required. Each size query adds a control-channel round trip.

top
AutoOptsUtf8
function CkFtp2_getAutoOptsUtf8(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putAutoOptsUtf8(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;
Introduced in version 9.5.0.47

Controls whether OPTS UTF8 ON is sent automatically when the server advertises UTF8 support. The default is True. This commonly causes CommandCharset and DirListingCharset to use UTF-8 for remote names and listings.

Set to False for a server that advertises UTF-8 but rejects the option or uses a different encoding in practice.

top
AutoSetUseEpsv
function CkFtp2_getAutoSetUseEpsv(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putAutoSetUseEpsv(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;
Introduced in version 9.5.0.44

Controls whether UseEpsv is enabled automatically when the server advertises support for EPSV. The default is False, and automatic detection also requires AutoFeat to be True.

Troubleshooting passive connections: EPSV avoids embedding an IP address in the server reply and is required for IPv6. Some legacy FTP-aware firewalls mishandle it; if passive data connections fail, test with both AutoSetUseEpsv and UseEpsv disabled.

top
AutoSyst
function CkFtp2_getAutoSyst(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putAutoSyst(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;

Controls whether a SYST command is sent automatically after connecting. The default is True. The server's operating-system type can help Chilkat interpret legacy LIST output and other server-specific behavior.

Set to False only when a particular server rejects or mishandles SYST.

top
AutoXcrc
function CkFtp2_getAutoXcrc(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putAutoXcrc(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;

Controls automatic post-upload verification with the server-specific XCRC command. When enabled and the server supports XCRC, Chilkat requests a CRC after each upload and treats a mismatch as transfer failure.

This extension is not part of the core FTP standard and is not supported by every server. Capability detection normally depends on AutoFeat.

Integrity scope: CRC verification can detect accidental corruption in transit or storage, but it is not a cryptographic authenticity check.

top
BandwidthThrottleDown
function CkFtp2_getBandwidthThrottleDown(objHandle: HCkFtp2): Integer; stdcall;
procedure CkFtp2_putBandwidthThrottleDown(objHandle: HCkFtp2; newPropVal: Integer); stdcall;

Specifies the approximate maximum download rate in bytes per second. The default value of 0 disables throttling.

Client-side download throttling is approximate because the server continues sending as permitted by TCP. The operating system's socket buffers absorb data between reads, so very small transfers may complete before the configured rate can be meaningfully enforced.

More Information and Examples
top
BandwidthThrottleUp
function CkFtp2_getBandwidthThrottleUp(objHandle: HCkFtp2): Integer; stdcall;
procedure CkFtp2_putBandwidthThrottleUp(objHandle: HCkFtp2; newPropVal: Integer); stdcall;

Specifies the approximate maximum upload rate in bytes per second. The default value of 0 disables throttling.

The limit is averaged over the transfer. Very small uploads may complete before the configured rate can be closely approximated.

More Information and Examples
top
ClientIpAddress
procedure CkFtp2_getClientIpAddress(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putClientIpAddress(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__clientIpAddress(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the local IP address to which outgoing FTP sockets are bound. Leave this property empty to let the operating system select the interface and source address.

Set it only on a multihomed system when the FTP control connection must originate from a particular interface. Supply a numeric IPv4 or IPv6 address, not a hostname.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
CommandCharset
procedure CkFtp2_getCommandCharset(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putCommandCharset(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__commandCharset(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the character encoding used for FTP commands that contain non-ASCII path or file names. The default is ansi. When the server advertises UTF-8 and AutoOptsUtf8 is enabled, this property may be changed automatically to utf-8.

FTP filename encoding: The original FTP protocol did not define one universal encoding for path names. The client and server must use the same encoding; UTF-8 is preferred when the server supports it.

See the notes about PWideChar memory ownership and validity.

top
ConnectFailReason
function CkFtp2_getConnectFailReason(objHandle: HCkFtp2): Integer; stdcall;

Contains a numeric reason code after Connect or ConnectOnly fails. Use this value for broad classification and inspect LastErrorText for detailed diagnostics.

CodeMeaning
0Success.
1The hostname is empty.
2DNS lookup failed.
3DNS lookup timed out.
4Cancelled by the application.
5Internal failure.
6TCP connection timed out.
7TCP connection was rejected or otherwise failed.
100Internal TLS failure.
101Failed to send the TLS ClientHello.
102An unexpected TLS handshake message was received.
103Failed to read the ServerHello.
104The server did not provide a certificate.
105Unexpected TLS protocol version.
106Server certificate verification failed.
107The negotiated TLS version is not allowed.
109Failed while reading TLS handshake messages.
110Failed to send the client-certificate handshake message.
111Failed to send the client key exchange.
112The client certificate private key is not accessible.
113Failed to send client certificate verification.
114Failed to send ChangeCipherSpec.
115Failed to send the Finished handshake message.
116The server Finished message is invalid.
200Connected, but the FTP greeting was not received.
201The AUTH TLS or AUTH SSL upgrade failed.
300An asynchronous operation is already in progress.
301FTP authentication failed.

top
ConnectTimeout
function CkFtp2_getConnectTimeout(objHandle: HCkFtp2): Integer; stdcall;
procedure CkFtp2_putConnectTimeout(objHandle: HCkFtp2; newPropVal: Integer); stdcall;

Specifies the maximum number of seconds to wait while establishing the TCP connection to the FTP server. The default is 30. A value of 0 waits indefinitely.

This timeout covers connection establishment, not subsequent FTP replies or file data. Use IdleTimeoutMs and ReadTimeout for those operations.

top
ConnectVerified
function CkFtp2_getConnectVerified(objHandle: HCkFtp2): wordbool; stdcall;

Indicates whether the TCP connection to the FTP server was established during the most recent call to Connect or ConnectOnly. It does not indicate that FTP authentication succeeded; see LoginVerified.

top
CrlfMode
function CkFtp2_getCrlfMode(objHandle: HCkFtp2): Integer; stdcall;
procedure CkFtp2_putCrlfMode(objHandle: HCkFtp2; newPropVal: Integer); stdcall;

Controls line-ending conversion when downloading in ASCII transfer mode. The default is 0.

ValueDownloaded text
0Leaves line endings as received.
1Converts line endings to CRLF.
2Converts line endings to LF.
3Converts line endings to CR.
Binary mode: This property has no effect on binary transfers. Use binary mode for files whose bytes must be preserved exactly.

top
CurBytesReceived
function CkFtp2_getCurBytesReceived(objHandle: HCkFtp2): LongWord; stdcall;
Introduced in version 11.0.0

Returns the number of bytes received during the current FTP download as a 32-bit unsigned integer. The value is updated while the transfer is in progress and may be read from another thread to display progress.

top
CurBytesReceived64
function CkFtp2_getCurBytesReceived64(objHandle: HCkFtp2): Int64; stdcall;
Introduced in version 11.0.0

Returns the number of bytes received during the current FTP download as a 64-bit integer. The value is updated while the transfer is in progress and may be read from another thread to display progress.

top
CurBytesReceivedStr
procedure CkFtp2_getCurBytesReceivedStr(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
function CkFtp2__curBytesReceivedStr(objHandle: HCkFtp2): PWideChar; stdcall;
Introduced in version 11.0.0

Returns the number of bytes received during the current FTP download as a decimal string. The value is updated while the transfer is in progress and may be read from another thread to display progress.

See the notes about PWideChar memory ownership and validity.

top
CurBytesSent
function CkFtp2_getCurBytesSent(objHandle: HCkFtp2): LongWord; stdcall;
Introduced in version 11.0.0

Returns the number of bytes sent during the current FTP upload as a 32-bit unsigned integer. The value is updated while the transfer is in progress and may be read from another thread to display progress.

top
CurBytesSent64
function CkFtp2_getCurBytesSent64(objHandle: HCkFtp2): Int64; stdcall;
Introduced in version 11.0.0

Returns the number of bytes sent during the current FTP upload as a 64-bit integer. The value is updated while the transfer is in progress and may be read from another thread to display progress.

top
CurBytesSentStr
procedure CkFtp2_getCurBytesSentStr(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
function CkFtp2__curBytesSentStr(objHandle: HCkFtp2): PWideChar; stdcall;
Introduced in version 11.0.0

Returns the number of bytes sent during the current FTP upload as a decimal string. The value is updated while the transfer is in progress and may be read from another thread to display progress.

See the notes about PWideChar memory ownership and validity.

top
DataProtection
procedure CkFtp2_getDataProtection(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putDataProtection(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__dataProtection(objHandle: HCkFtp2): PWideChar; stdcall;
Introduced in version 9.5.0.52

Specifies the protection level for FTP data connections. The value is compared case-insensitively.

ValueBehavior
controlDefault. Data connections use the same protection state as the control connection.
clearData connections use unencrypted TCP, even when the control connection uses TLS.
privateData connections are protected with TLS.
Control and data channels: FTP uses one long-lived control connection and a separate data connection for each listing, upload, or download. FTPS can protect these channels independently.

See the notes about PWideChar memory ownership and validity.

top
DebugLogFilePath
procedure CkFtp2_getDebugLogFilePath(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putDebugLogFilePath(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__debugLogFilePath(objHandle: HCkFtp2): PWideChar; stdcall;

If set to a file path, this property logs the LastErrorText of each Chilkat method or property call to the specified file. This logging helps identify the context and history of Chilkat calls leading up to any crash or hang, aiding in debugging.

Enabling the VerboseLogging property provides more detailed information. This property is mainly used for debugging rare instances where a Chilkat method call causes a hang or crash, which should generally not happen.

Possible causes of hangs include:

  • A timeout property set to 0, indicating an infinite timeout.
  • A hang occurring within an event callback in the application code.
  • An internal bug in the Chilkat code causing the hang.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
DirListingCharset
procedure CkFtp2_getDirListingCharset(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putDirListingCharset(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__dirListingCharset(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the character encoding used to decode legacy directory-listing bytes and remote names. The default is ansi. When the server advertises UTF-8 and AutoOptsUtf8 is enabled, this property may be changed automatically to utf-8.

This setting is most important when LIST or NLST is used. MLSD provides a standardized listing format, but names must still be decoded using the encoding used by the server.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
DownloadTransferRate
function CkFtp2_getDownloadTransferRate(objHandle: HCkFtp2): Integer; stdcall;

Returns the current average download rate in bytes per second. The value is updated during synchronous and asynchronous downloads and describes the transfer in progress or the most recently completed download.

top
EnableSecrets
function CkFtp2_getEnableSecrets(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putEnableSecrets(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;
Introduced in version 11.5.0

Controls automatic resolution of credential values from secure operating-system storage. The default is False. When enabled, supported password properties may contain a secret specification beginning with !! instead of the literal password.

!![appName|]service[|domain]|username

Secret specifications are supported by Password, HttpProxyPassword, ProxyPassword, and SocksPassword. Chilkat resolves them through Windows Credential Manager on Windows or Apple Keychain on macOS.

Credential handling: This feature avoids embedding plaintext credentials in source code or configuration. Access to the secret still depends on the permissions of the process and operating-system account.

More Information and Examples
top
ForcePortIpAddress
procedure CkFtp2_getForcePortIpAddress(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putForcePortIpAddress(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__forcePortIpAddress(objHandle: HCkFtp2): PWideChar; stdcall;

Overrides the IP address advertised to the server in active-mode PORT commands. Supply a numeric IPv4 address, the keyword control, or a value prefixed with bind-.

  • control uses the local address of the established control connection.
  • bind-192.0.2.10 both advertises the address and binds the local data-listener socket to it.
  • A plain address changes only the address sent in the FTP command.
NAT caution: The advertised address must be reachable from the FTP server. Incorrect active-mode addressing commonly causes transfers to hang after the control command succeeds.

See the notes about PWideChar memory ownership and validity.

top
Greeting
procedure CkFtp2_getGreeting(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
function CkFtp2__greeting(objHandle: HCkFtp2): PWideChar; stdcall;

Contains the initial FTP server greeting received immediately after the TCP or implicit-TLS connection is established. It normally begins with reply code 220 and may include server identification or policy information.

See the notes about PWideChar memory ownership and validity.

top
HasModeZ
function CkFtp2_getHasModeZ(objHandle: HCkFtp2): wordbool; stdcall;

Indicates whether the server advertised support for MODE Z, which compresses FTP data streams using the DEFLATE algorithm. Call SetModeZ after connecting to enable it.

top
HeartbeatMs
function CkFtp2_getHeartbeatMs(objHandle: HCkFtp2): Integer; stdcall;
procedure CkFtp2_putHeartbeatMs(objHandle: HCkFtp2; newPropVal: Integer); stdcall;

Specifies the interval, in milliseconds, between AbortCheck callbacks during methods that support periodic cancellation checks. The default is 0, which disables these callbacks.

Smaller values can improve cancellation responsiveness but increase callback overhead. Methods that complete quickly may not generate a callback.

More Information and Examples
top
Hostname
procedure CkFtp2_getHostname(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putHostname(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__hostname(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the FTP server hostname or numeric IPv4/IPv6 address. Do not include a URL scheme, path, or port; configure the port separately with Port.

See the notes about PWideChar memory ownership and validity.

top
HttpProxyAuthMethod
procedure CkFtp2_getHttpProxyAuthMethod(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putHttpProxyAuthMethod(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__httpProxyAuthMethod(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the authentication method used with an HTTP proxy. Supported values are Basic and NTLM. Leave empty when the proxy does not require authentication.

See the notes about PWideChar memory ownership and validity.

top
HttpProxyDomain
procedure CkFtp2_getHttpProxyDomain(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putHttpProxyDomain(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__httpProxyDomain(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the Windows domain used for NTLM authentication to the HTTP proxy. It is ignored for Basic authentication and may be left empty when the username already includes the required domain information.

See the notes about PWideChar memory ownership and validity.

top
HttpProxyHostname
procedure CkFtp2_getHttpProxyHostname(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putHttpProxyHostname(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__httpProxyHostname(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the hostname or numeric IP address of an HTTP proxy used to establish the FTP control connection. Leave empty to connect directly.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
HttpProxyPassword
procedure CkFtp2_getHttpProxyPassword(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putHttpProxyPassword(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__httpProxyPassword(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the password used to authenticate to the HTTP proxy. It is used together with HttpProxyUsername and HttpProxyAuthMethod.

See the notes about PWideChar memory ownership and validity.

top
HttpProxyPort
function CkFtp2_getHttpProxyPort(objHandle: HCkFtp2): Integer; stdcall;
procedure CkFtp2_putHttpProxyPort(objHandle: HCkFtp2; newPropVal: Integer); stdcall;

Specifies the TCP port of the HTTP proxy. Common values include 8080 and 3128, but the correct value is determined by the proxy configuration.

top
HttpProxyUsername
procedure CkFtp2_getHttpProxyUsername(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putHttpProxyUsername(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__httpProxyUsername(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the username used to authenticate to the HTTP proxy. Leave empty when the proxy allows unauthenticated connections.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
IdleTimeoutMs
function CkFtp2_getIdleTimeoutMs(objHandle: HCkFtp2): Integer; stdcall;
procedure CkFtp2_putIdleTimeoutMs(objHandle: HCkFtp2; newPropVal: Integer); stdcall;

Specifies the maximum period, in milliseconds, during which no control-channel response or forward upload progress is observed. The default is 60000; 0 waits indefinitely.

During an upload, the same limit applies when the operating-system send buffer remains full because the server is not consuming data.

top
IsConnected
function CkFtp2_getIsConnected(objHandle: HCkFtp2): wordbool; stdcall;

Deprecated. Indicates whether the object appears to be connected and authenticated. Reading this property may send NOOP to test the session. Use CheckConnection instead.

top
KeepSessionLog
function CkFtp2_getKeepSessionLog(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putKeepSessionLog(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;

Controls collection of an in-memory FTP protocol log. When enabled, commands and server replies are available in SessionLog. Use ClearSessionLog to discard previously collected text.

More Information and Examples
top
LargeFileMeasures
function CkFtp2_getLargeFileMeasures(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putLargeFileMeasures(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;
Introduced in version 9.5.0.66

Enables additional measures intended for very long uploads and downloads. The default is False. When enabled, Chilkat periodically keeps the FTP control connection active so that servers, firewalls, and NAT devices are less likely to close it while a long data transfer is in progress.

Enable this only when long transfers succeed on the data channel but the idle control connection is being dropped.

top
LastErrorHtml
procedure CkFtp2_getLastErrorHtml(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
function CkFtp2__lastErrorHtml(objHandle: HCkFtp2): PWideChar; stdcall;

Provides HTML-formatted information about the last called method or property. If a method call fails or behaves unexpectedly, check this property for details. Note that information is available regardless of the method call's success.

See the notes about PWideChar memory ownership and validity.

top
LastErrorText
procedure CkFtp2_getLastErrorText(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
function CkFtp2__lastErrorText(objHandle: HCkFtp2): PWideChar; stdcall;

Provides plain text information about the last called method or property. If a method call fails or behaves unexpectedly, check this property for details. Note that information is available regardless of the method call's success.

See the notes about PWideChar memory ownership and validity.

top
LastErrorXml
procedure CkFtp2_getLastErrorXml(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
function CkFtp2__lastErrorXml(objHandle: HCkFtp2): PWideChar; stdcall;

Provides XML-formatted information about the last called method or property. If a method call fails or behaves unexpectedly, check this property for details. Note that information is available regardless of the method call's success.

See the notes about PWideChar memory ownership and validity.

top
LastMethodSuccess
function CkFtp2_getLastMethodSuccess(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putLastMethodSuccess(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;

Indicates the success or failure of the most recent method call: True means success, False means failure. This property remains unchanged by property setters or getters. This method is present to address challenges in checking for null or Nothing returns in certain programming languages. Note: This property does not apply to methods that return integer values or to boolean-returning methods where the boolean does not indicate success or failure.

top
LastReply
procedure CkFtp2_getLastReply(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
function CkFtp2__lastReply(objHandle: HCkFtp2): PWideChar; stdcall;

Contains the most recent FTP control-channel reply, including its three-digit status code and message. Examples include 250 Directory successfully changed. and 550 Failed to change directory.

Some replies are multiline; use this property together with the method return value and LastErrorText when diagnosing a failure.

See the notes about PWideChar memory ownership and validity.

top
ListOption
procedure CkFtp2_getListOption(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putListOption(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__listOption(objHandle: HCkFtp2): PWideChar; stdcall;
Introduced in version 11.4.0

Specifies an option string appended to the legacy LIST command, such as -a. It has no effect when AllowMlsd causes MLSD to be used.

LIST options and output formats are not standardized by FTP. Many UNIX-like servers pass the option to an underlying ls implementation, while other servers may reject or interpret it differently.

See the notes about PWideChar memory ownership and validity.

top
ListPattern
procedure CkFtp2_getListPattern(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putListPattern(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__listPattern(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the wildcard pattern used when Chilkat populates its cached listing of the current remote directory. The default is *. It affects methods such as GetDirCount, GetFilename, GetIsDirectory, GetSize, and the listing timestamp methods.

Specify only a name pattern, such as *.txt. To list subdir/*.txt, first call ChangeRemoteDir for subdir, then set this property to *.txt.

Listing cache: Changing this property invalidates the cached directory listing. The server, not Chilkat, may ultimately determine wildcard behavior when LIST or NLST is used.

See the notes about PWideChar memory ownership and validity.

top
LoginVerified
function CkFtp2_getLoginVerified(objHandle: HCkFtp2): wordbool; stdcall;

Indicates whether FTP authentication succeeded during the most recent call to Connect or LoginAfterConnectOnly. A TCP connection may be established even when this property is False; see ConnectVerified.

top
PartialTransfer
function CkFtp2_getPartialTransfer(objHandle: HCkFtp2): wordbool; stdcall;

Indicates whether the most recent download method received some, but not all, of the remote file. It is False when no data was received or when the complete file was received.

This property helps distinguish a mid-transfer failure from a failure that occurred before any file data arrived.

top
Passive
function CkFtp2_getPassive(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putPassive(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;

Selects the FTP data-connection mode. The default is True for passive mode. Set to False for active mode.

ModeConnection direction
PassiveThe server listens and the client connects to the server for each data transfer.
ActiveThe client listens and the server connects back to the client.
Typical choice: Passive mode is usually preferred because it works more naturally through client-side firewalls and NAT. Active mode requires an inbound connection to the client.

top
PassiveUseHostAddr
function CkFtp2_getPassiveUseHostAddr(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putPassiveUseHostAddr(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;

Controls how the address returned by PASV is handled. The default is True. When enabled, Chilkat ignores the IP address embedded in the server's PASV reply and connects to the control connection's server address using only the returned port.

This avoids private or otherwise unreachable addresses returned by FTP servers behind NAT, especially when TLS prevents a network device from rewriting the reply.

top
Password
procedure CkFtp2_getPassword(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putPassword(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__password(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the password used for FTP authentication. For anonymous FTP, this is commonly an email address or arbitrary identifying string. Applications that already store the password in a SecureString should use SetSecurePassword instead.

See the notes about PWideChar memory ownership and validity.

top
PercentDoneScale
function CkFtp2_getPercentDoneScale(objHandle: HCkFtp2): Integer; stdcall;
procedure CkFtp2_putPercentDoneScale(objHandle: HCkFtp2; newPropVal: Integer); stdcall;
Introduced in version 9.5.0.49

Specifies the integer value that represents 100 percent in PercentDone callbacks. The default is 100. For example, a scale of 1000 allows one-tenth-percent resolution, where callback value 453 represents 45.3 percent.

The value is limited to the range 10 through 100000. This property is relevant only in environments that support event callbacks and only for operations whose total work can be measured.

top
Port
function CkFtp2_getPort(objHandle: HCkFtp2): Integer; stdcall;
procedure CkFtp2_putPort(objHandle: HCkFtp2; newPropVal: Integer); stdcall;

Specifies the FTP server port. The usual port is 21 for plain FTP or explicit FTPS and 990 for implicit FTPS. When AutoFix is enabled, Chilkat adjusts the implicit/explicit TLS settings for these standard ports.

top
PreferIpv6
function CkFtp2_getPreferIpv6(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putPreferIpv6(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;

Controls address-family preference when a hostname resolves to both IPv4 and IPv6 addresses. The default is False, which prefers IPv4. Set to True to prefer IPv6.

This setting does not force an unavailable protocol; it determines which address family is attempted first when both are present.

top
PreferNlst
function CkFtp2_getPreferNlst(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putPreferNlst(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;

Controls whether NLST is preferred over LIST when a legacy directory listing is required. The default is False. NLST generally returns names only and therefore cannot provide reliable sizes, timestamps, ownership, or permissions.

When to use: Enable this only for a server whose LIST output truncates or corrupts names. KeepAllowMlsd enabled whenever possible because MLSD is the standardized machine-readable listing command.

top
ProgressMonSize
function CkFtp2_getProgressMonSize(objHandle: HCkFtp2): Integer; stdcall;
procedure CkFtp2_putProgressMonSize(objHandle: HCkFtp2; newPropVal: Integer); stdcall;

Specifies the expected size, in bytes, of the next file downloaded by GetFile when the server does not provide a usable size. Chilkat uses the value to calculate percentage progress. It applies to the next download and should be set immediately before the call.

top
ProgressMonSize64
function CkFtp2_getProgressMonSize64(objHandle: HCkFtp2): Int64; stdcall;
procedure CkFtp2_putProgressMonSize64(objHandle: HCkFtp2; newPropVal: Int64); stdcall;

The 64-bit form of ProgressMonSize. Specifies the expected size, in bytes, of the next download when the value may exceed the 32-bit integer range.

top
ProxyHostname
procedure CkFtp2_getProxyHostname(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putProxyHostname(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__proxyHostname(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the hostname or IP address of a traditional FTP application proxy or firewall. This is distinct from an HTTP CONNECT proxy and from a SOCKS proxy. The login sequence is selected by ProxyMethod.

See the notes about PWideChar memory ownership and validity.

top
ProxyMethod
function CkFtp2_getProxyMethod(objHandle: HCkFtp2): Integer; stdcall;
procedure CkFtp2_putProxyMethod(objHandle: HCkFtp2; newPropVal: Integer); stdcall;

Selects the login sequence required by a traditional FTP proxy or firewall. The default is 0, meaning no FTP proxy. Configure ProxyHostname, ProxyPort, and the required proxy credentials before connecting.

ValueSequence sent
1 — SITE
USER ProxyUsername
PASS ProxyPassword
SITE Hostname
USER Username
PASS Password
2 — USER user@site
USER Username@Hostname:Port
PASS Password
3 — USER with proxy login
USER ProxyUsername
PASS ProxyPassword
USER Username@Hostname:Port
PASS Password
4 — USER/PASS/ACCT
USER Username@Hostname:Port ProxyUsername
PASS Password
ACCT ProxyPassword
5 — OPEN
USER ProxyUsername
PASS ProxyPassword
OPEN Hostname
USER Username
PASS Password
6 — firewall ID
USER ProxyUsername@Hostname
USER Username
PASS Password
7
USER ProxyUsername
USER ProxyPassword
SITE Hostname:Port
USER Username
PASS Password
8
USER Username@ProxyUsername@Hostname
PASS Password@ProxyPassword
9
ProxyUsername
ProxyPassword
Username
Password
Server-specific feature: These sequences describe historical FTP firewall conventions, not one standardized proxy protocol. Use the value required by the proxy administrator.

top
ProxyPassword
procedure CkFtp2_getProxyPassword(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putProxyPassword(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__proxyPassword(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the password used to authenticate to a traditional FTP proxy or firewall. Its placement in the login exchange depends on ProxyMethod.

See the notes about PWideChar memory ownership and validity.

top
ProxyPort
function CkFtp2_getProxyPort(objHandle: HCkFtp2): Integer; stdcall;
procedure CkFtp2_putProxyPort(objHandle: HCkFtp2; newPropVal: Integer); stdcall;

Specifies the TCP port on which the traditional FTP proxy or firewall accepts connections.

top
ProxyUsername
procedure CkFtp2_getProxyUsername(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putProxyUsername(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__proxyUsername(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the username used to authenticate to a traditional FTP proxy or firewall. Its placement in the login exchange depends on ProxyMethod.

See the notes about PWideChar memory ownership and validity.

top
ReadTimeout
function CkFtp2_getReadTimeout(objHandle: HCkFtp2): Integer; stdcall;
procedure CkFtp2_putReadTimeout(objHandle: HCkFtp2; newPropVal: Integer); stdcall;

Specifies the maximum number of seconds that a data connection may remain without receiving additional bytes. The default is 60.

This is an inactivity timeout, not a limit on total transfer duration. A large download may run indefinitely as long as data continues arriving within the configured interval.

top
RequireSslCertVerify
function CkFtp2_getRequireSslCertVerify(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putRequireSslCertVerify(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;

Controls whether the FTP server certificate must pass normal TLS validation. When enabled, an untrusted chain, invalid signature, expired or not-yet-valid certificate, or hostname mismatch causes the TLS connection to fail.

Security recommendation: Enable certificate verification for production FTPS connections. Disabling verification encrypts the connection but does not reliably authenticate the server.

top
RestartNext
function CkFtp2_getRestartNext(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putRestartNext(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;

Set to True immediately before an upload or download method to request that the transfer resume from the existing file position instead of starting over. The setting applies to the next applicable transfer.

Resume requires compatible server support and a correct partial local or remote file. The application should verify that the existing content belongs to the same file version before resuming.

top
SessionLog
procedure CkFtp2_getSessionLog(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
function CkFtp2__sessionLog(objHandle: HCkFtp2): PWideChar; stdcall;

Contains the in-memory FTP session log collected while KeepSessionLog is True. The log includes protocol commands and server replies and is useful for troubleshooting. Passwords and other sensitive information may appear; handle the text accordingly.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
SocksHostname
procedure CkFtp2_getSocksHostname(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putSocksHostname(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__socksHostname(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the hostname or IP address of the SOCKS proxy. It is used only when SocksVersion is 4 or 5.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
SocksPassword
procedure CkFtp2_getSocksPassword(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putSocksPassword(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__socksPassword(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the password for SOCKS5 username/password authentication. It is ignored for SOCKS4, which has no password-authentication field.

See the notes about PWideChar memory ownership and validity.

top
SocksPort
function CkFtp2_getSocksPort(objHandle: HCkFtp2): Integer; stdcall;
procedure CkFtp2_putSocksPort(objHandle: HCkFtp2; newPropVal: Integer); stdcall;

Specifies the SOCKS proxy port. The default is 1080. It is used only when SocksVersion is 4 or 5.

top
SocksUsername
procedure CkFtp2_getSocksUsername(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putSocksUsername(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__socksUsername(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the SOCKS user identifier. SOCKS5 may use it with password authentication; SOCKS4 sends it as the protocol user ID. It is used only when SocksVersion is 4 or 5.

See the notes about PWideChar memory ownership and validity.

top
SocksVersion
function CkFtp2_getSocksVersion(objHandle: HCkFtp2): Integer; stdcall;
procedure CkFtp2_putSocksVersion(objHandle: HCkFtp2; newPropVal: Integer); stdcall;

Selects SOCKS proxy usage.

ValueBehavior
0Default. Connect directly without a SOCKS proxy.
4Connect through a SOCKS4 proxy.
5Connect through a SOCKS5 proxy.

top
SoRcvBuf
function CkFtp2_getSoRcvBuf(objHandle: HCkFtp2): Integer; stdcall;
procedure CkFtp2_putSoRcvBuf(objHandle: HCkFtp2; newPropVal: Integer); stdcall;

Specifies the requested receive-buffer size, in bytes, for FTP data sockets. The default is 4194304. Normally this should remain unchanged.

A larger buffer can help on high-bandwidth, high-latency paths, but actual buffer sizing is controlled by the operating system. This setting does not apply to the FTP control connection.

top
SoSndBuf
function CkFtp2_getSoSndBuf(objHandle: HCkFtp2): Integer; stdcall;
procedure CkFtp2_putSoSndBuf(objHandle: HCkFtp2; newPropVal: Integer); stdcall;

Specifies the requested send-buffer size, in bytes, for FTP data sockets. The default is 262144. Normally this should remain unchanged.

Testing larger values can help uploads on high-bandwidth, high-latency paths, but actual buffer sizing is controlled by the operating system. This setting does not apply to the FTP control connection.

top
Ssl
function CkFtp2_getSsl(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putSsl(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;

Set to True to use implicit FTP over TLS, normally on port 990. TLS begins immediately when the TCP connection is established. Do not also enable AuthTls or AuthSsl, which select explicit FTPS.

Protocol distinction: FTPS is FTP protected by TLS. SFTP is a different protocol provided by SSH and is implemented by the SFTP class, not Ftp2.

More Information and Examples
top
SslAllowedCiphers
procedure CkFtp2_getSslAllowedCiphers(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putSslAllowedCiphers(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__sslAllowedCiphers(objHandle: HCkFtp2): PWideChar; stdcall;
Introduced in version 9.5.0.48

Restricts the TLS cipher suites offered by the client. The default empty string allows the cipher suites enabled by the Chilkat build and its TLS policy. To restrict negotiation, supply a comma-separated list of IANA cipher-suite names in preference order.

The server selects one suite from the overlap between the client and server lists. Additional compatibility keywords supported by Chilkat may also be included, such as rsa2048, secure-renegotiation, or best-practices.

Prefer policy over hard-coded suites: Cipher availability changes with TLS versions, platforms, and security updates. Use the default or best-practices policy unless interoperability requirements demand an explicit list. Avoid obsolete RC4, DES, 3DES, and export-grade suites.

See the notes about PWideChar memory ownership and validity.

top
SslProtocol
procedure CkFtp2_getSslProtocol(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putSslProtocol(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__sslProtocol(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the TLS protocol policy for implicit and explicit FTPS connections. The default is default, which allows Chilkat to negotiate an appropriate protocol supported by both peers.

Example valueBehavior
defaultUses the library's current secure protocol policy.
TLS 1.3Requires exactly TLS 1.3.
TLS 1.2Requires exactly TLS 1.2.
TLS 1.2 or higherAllows TLS 1.2 and newer supported versions.
TLS 1.0 or higherAllows legacy TLS 1.0 and newer supported versions.

Other exact and or higher forms accepted by the API may be used for compatibility. Choosing an exact version causes the connection to fail if the server cannot negotiate that version.

Security guidance: Use default or TLS 1.2 or higher for modern deployments. TLS 1.0, TLS 1.1, and SSL 3.0 are obsolete and should be enabled only for a controlled legacy system.

See the notes about PWideChar memory ownership and validity.

top
SslServerCertVerified
function CkFtp2_getSslServerCertVerified(objHandle: HCkFtp2): wordbool; stdcall;

Indicates whether the server's TLS certificate chain and validity checks succeeded for the current or most recent FTPS connection. It is meaningful only after a TLS connection attempt.

This property reports certificate verification; the method return value and LastErrorText remain the authoritative indicators of overall connection success.

top
SyncCreateAllLocalDirs
function CkFtp2_getSyncCreateAllLocalDirs(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putSyncCreateAllLocalDirs(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;
Introduced in version 9.5.0.76

Controls whether download synchronization creates empty remote directories on the local filesystem. The default is True. When False, a local directory is created only when it is needed to contain a downloaded file.

top
SyncMustMatch
procedure CkFtp2_getSyncMustMatch(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putSyncMustMatch(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__syncMustMatch(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies a semicolon-separated list of case-insensitive wildcard patterns for files that are eligible for synchronization and tree operations. For example: *.xml;*.txt;*.csv.

When nonempty, a file must match at least one pattern. This filter applies to synchronization methods and also to DownloadTree and DirTreeXml.

See the notes about PWideChar memory ownership and validity.

top
SyncMustMatchDir
procedure CkFtp2_getSyncMustMatchDir(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putSyncMustMatchDir(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__syncMustMatchDir(objHandle: HCkFtp2): PWideChar; stdcall;
Introduced in version 9.5.0.76

Specifies a semicolon-separated list of case-insensitive wildcard patterns for directories that synchronization methods are allowed to enter. For example: src;data_*;reports. When nonempty, a directory must match at least one pattern before its contents are traversed.

See the notes about PWideChar memory ownership and validity.

top
SyncMustNotMatch
procedure CkFtp2_getSyncMustNotMatch(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putSyncMustNotMatch(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__syncMustNotMatch(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies a semicolon-separated list of case-insensitive wildcard patterns for files that must be excluded from synchronization and tree operations. For example: *.tmp;*.bak;~*.

Exclusion is applied in addition to SyncMustMatch. This filter also applies to DownloadTree and DirTreeXml.

See the notes about PWideChar memory ownership and validity.

top
SyncMustNotMatchDir
procedure CkFtp2_getSyncMustNotMatchDir(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putSyncMustNotMatchDir(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__syncMustNotMatchDir(objHandle: HCkFtp2): PWideChar; stdcall;
Introduced in version 9.5.0.76

Specifies a semicolon-separated list of case-insensitive wildcard patterns for directories that synchronization methods must not enter. For example: .git;temp;archive_*. Exclusion is applied in addition to SyncMustMatchDir.

See the notes about PWideChar memory ownership and validity.

top
SyncPreview
procedure CkFtp2_getSyncPreview(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
function CkFtp2__syncPreview(objHandle: HCkFtp2): PWideChar; stdcall;

Contains the preview produced by SyncRemoteTree2 when ARG4 is True. Each CRLF-delimited line is a local path that would be uploaded if preview mode were disabled.

See the notes about PWideChar memory ownership and validity.

top
TlsCipherSuite
procedure CkFtp2_getTlsCipherSuite(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
function CkFtp2__tlsCipherSuite(objHandle: HCkFtp2): PWideChar; stdcall;
Introduced in version 9.5.0.49

Contains the cipher suite negotiated for the current or most recent successful TLS connection, such as TLS_AES_256_GCM_SHA384. It is empty before a TLS session has been established or after a failed attempt that produced no negotiated suite.

See the notes about PWideChar memory ownership and validity.

top
TlsPinSet
procedure CkFtp2_getTlsPinSet(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putTlsPinSet(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__tlsPinSet(objHandle: HCkFtp2): PWideChar; stdcall;
Introduced in version 9.5.0.55

Specifies one or more expected Subject Public Key Info (SPKI) fingerprints for TLS public-key pinning. The format is:

hashAlgorithm, encoding, fingerprint1, fingerprint2, ...
Example:
sha256, base64, lKg1SIqyhPSK19tlPbjl8s02yChsVTDklQpkMCHvsTE=

If the server certificate's SPKI fingerprint matches none of the listed pins, the TLS handshake fails. Multiple pins allow planned certificate or key rotation.

Pinning is additional validation: A matching pin does not make an expired, hostname-mismatched, or otherwise invalid certificate acceptable when normal certificate verification is required. Prefer SHA-256 or stronger hashes.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
TlsVersion
procedure CkFtp2_getTlsVersion(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
function CkFtp2__tlsVersion(objHandle: HCkFtp2): PWideChar; stdcall;
Introduced in version 9.5.0.49

Contains the protocol version negotiated for the current or most recent successful TLS connection, such as TLS 1.2 or TLS 1.3. It is empty when no TLS session has been established.

See the notes about PWideChar memory ownership and validity.

top
UncommonOptions
procedure CkFtp2_getUncommonOptions(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putUncommonOptions(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__uncommonOptions(objHandle: HCkFtp2): PWideChar; stdcall;
Introduced in version 9.5.0.78

Provides a comma-separated list of compatibility options for uncommon platform or server requirements. The default is empty and should normally remain empty.

KeywordEffect
OpenNonExclusiveOn Windows, opens a local download file without exclusive sharing so another process may access it while data is being written.
ProtectFromVpnOn Android, requests that FTP sockets bypass an active VPN.
EnableTls13Compatibility switch that explicitly enables offering TLS 1.3 in builds where it is not already enabled by policy.
DisableTls13Prevents TLS 1.3 negotiation for compatibility with a problematic peer.
NoPreserveFileTimeLeaves downloaded files with the current local time instead of attempting to preserve the remote modification time.
Use sparingly: These options alter low-level behavior and may be platform-specific. Configure one only when the documented default causes a known interoperability problem.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
UploadTransferRate
function CkFtp2_getUploadTransferRate(objHandle: HCkFtp2): Integer; stdcall;

Returns the current average upload rate in bytes per second. The value is updated during synchronous and asynchronous uploads and describes the transfer in progress or the most recently completed upload.

top
UseEpsv
function CkFtp2_getUseEpsv(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putUseEpsv(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;

Controls whether passive data connections use EPSV instead of PASV. The default is False. EPSV returns only a port number and is the passive command used with IPv6.

AutoSetUseEpsv can enable this property automatically when the server advertises support.

Compatibility: Some legacy FTP-aware firewalls mishandle EPSV. If a passive data connection fails, test with EPSV disabled; for IPv6, EPSV is required.

top
Username
procedure CkFtp2_getUsername(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
procedure CkFtp2_putUsername(objHandle: HCkFtp2; newPropVal: PWideChar); stdcall;
function CkFtp2__username(objHandle: HCkFtp2): PWideChar; stdcall;

Specifies the FTP login name. The default is anonymous. Set it to an empty string to have Connect establish the connection without performing authentication; authentication may then be handled separately with LoginAfterConnectOnly.

See the notes about PWideChar memory ownership and validity.

top
VerboseLogging
function CkFtp2_getVerboseLogging(objHandle: HCkFtp2): wordbool; stdcall;
procedure CkFtp2_putVerboseLogging(objHandle: HCkFtp2; newPropVal: wordbool); stdcall;

If set to True, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. The default value is False. Verbose logging should only be used for debugging. The potentially large quantity of logged information may adversely affect peformance.

top
Version
procedure CkFtp2_getVersion(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
function CkFtp2__version(objHandle: HCkFtp2): PWideChar; stdcall;

Version of the component/library, such as "10.1.0"

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top

Methods

AppendFile
function CkFtp2_AppendFile(objHandle: HCkFtp2;
    localFilePath: PWideChar;
    remoteFilePath: PWideChar): wordbool; stdcall;

Appends the contents of the local file at localFilePath to the remote file at remoteFilePath. If the remote file does not exist, server behavior may be equivalent to creating it. Both arguments are paths in their respective local and remote filesystems.

Returns True for success, False for failure.

top
AppendFileAsync (1)
function CkFtp2_AppendFileAsync(objHandle: HCkFtp2;
    localFilePath: PWideChar;
    remoteFilePath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the AppendFile method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
AppendFileBd
function CkFtp2_AppendFileBd(objHandle: HCkFtp2;
    remoteFilename: PWideChar;
    bd: HCkBinData): wordbool; stdcall;
Introduced in version 11.0.0

Appends the bytes in the BinData object bd to the remote file at remoteFilename. No text encoding or line-ending conversion is performed.

Returns True for success, False for failure.

top
AppendFileBdAsync (1)
function CkFtp2_AppendFileBdAsync(objHandle: HCkFtp2;
    remoteFilename: PWideChar;
    bd: HCkBinData): HCkTask; stdcall;
Introduced in version 11.0.0

Creates an asynchronous task to call the AppendFileBd method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
AppendFileFromTextData
function CkFtp2_AppendFileFromTextData(objHandle: HCkFtp2;
    remoteFilename: PWideChar;
    textData: PWideChar;
    charset: PWideChar): wordbool; stdcall;

Encodes the text in textData using the character encoding named by charset and appends the resulting bytes to the remote file at remoteFilename.

This method controls the encoding of the file content. The encoding used for the remote filename itself is controlled separately by CommandCharset.

Returns True for success, False for failure.

top
AppendFileFromTextDataAsync (1)
function CkFtp2_AppendFileFromTextDataAsync(objHandle: HCkFtp2;
    remoteFilename: PWideChar;
    textData: PWideChar;
    charset: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the AppendFileFromTextData method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
AppendFileSb
function CkFtp2_AppendFileSb(objHandle: HCkFtp2;
    remoteFilename: PWideChar;
    sb: HCkStringBuilder;
    charset: PWideChar): wordbool; stdcall;
Introduced in version 11.0.0

Encodes the text in the StringBuilder sb using the charset named by charset and appends the resulting bytes to the remote file at remoteFilename.

Returns True for success, False for failure.

top
AppendFileSbAsync (1)
function CkFtp2_AppendFileSbAsync(objHandle: HCkFtp2;
    remoteFilename: PWideChar;
    sb: HCkStringBuilder;
    charset: PWideChar): HCkTask; stdcall;
Introduced in version 11.0.0

Creates an asynchronous task to call the AppendFileSb method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
ChangeRemoteDir
function CkFtp2_ChangeRemoteDir(objHandle: HCkFtp2;
    remoteDirPath: PWideChar): wordbool; stdcall;

Changes the current working directory on the FTP server to remoteDirPath. A relative path is resolved from the current remote directory; an absolute path is interpreted according to the server's path syntax.

Some servers accept a multi-level path in one CWD command, while others require one directory level at a time.

Current directory: Many Ftp2 methods operate relative to the current remote directory. Use GetCurrentRemoteDir to inspect it.

Returns True for success, False for failure.

top
ChangeRemoteDirAsync (1)
function CkFtp2_ChangeRemoteDirAsync(objHandle: HCkFtp2;
    remoteDirPath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the ChangeRemoteDir method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
CheckConnection
function CkFtp2_CheckConnection(objHandle: HCkFtp2): wordbool; stdcall;
Introduced in version 9.5.0.44

Tests whether the FTP control session is still connected and authenticated. The method may send NOOP so the result reflects the server's response rather than only the local socket state.

Returns True for success, False for failure.

top
CheckConnectionAsync (1)
function CkFtp2_CheckConnectionAsync(objHandle: HCkFtp2): HCkTask; stdcall;
Introduced in version 9.5.0.44

Creates an asynchronous task to call the CheckConnection method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
ClearControlChannel
function CkFtp2_ClearControlChannel(objHandle: HCkFtp2): wordbool; stdcall;

Requests that an explicit-FTPS control connection return to clear text after authentication. Data connections may remain protected according to DataProtection.

Security and compatibility: This is a legacy workaround for FTP-aware NAT devices that must inspect PORT or PASV commands. It exposes FTP commands and replies, including path names, and should not be used unless required by the network environment.

Returns True for success, False for failure.

top
ClearControlChannelAsync (1)
function CkFtp2_ClearControlChannelAsync(objHandle: HCkFtp2): HCkTask; stdcall;

Creates an asynchronous task to call the ClearControlChannel method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
ClearDirCache
procedure CkFtp2_ClearDirCache(objHandle: HCkFtp2) stdcall;

Clears the cached listing for the current remote directory. The next call to GetDirCount or another indexed listing method retrieves a fresh listing from the server. The cache is also invalidated when the current directory or ListPattern changes.

top
ClearSessionLog
procedure CkFtp2_ClearSessionLog(objHandle: HCkFtp2) stdcall;

Clears the in-memory FTP protocol log collected while KeepSessionLog is enabled.

top
Connect
function CkFtp2_Connect(objHandle: HCkFtp2): wordbool; stdcall;

Connects to the server specified by Hostname and Port, negotiates any configured TLS or proxy layer, receives the FTP greeting, and authenticates using Username, Password, and Account.

To separate connection establishment from authentication, call ConnectOnly followed by LoginAfterConnectOnly.

Failure diagnosis: After failure, inspect ConnectFailReason, LastReply, and LastErrorText. A failure before the FTP greeting is usually DNS, routing, firewall, proxy, TCP, or TLS related; a failure after the greeting is commonly authentication or server policy.

Returns True for success, False for failure.

top
ConnectAsync (1)
function CkFtp2_ConnectAsync(objHandle: HCkFtp2): HCkTask; stdcall;

Creates an asynchronous task to call the Connect method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
ConnectOnly
function CkFtp2_ConnectOnly(objHandle: HCkFtp2): wordbool; stdcall;

Establishes the configured proxy, TCP, and TLS connection and receives the FTP server greeting, but does not send the FTP login commands. Complete authentication by calling LoginAfterConnectOnly.

Returns True for success, False for failure.

top
ConnectOnlyAsync (1)
function CkFtp2_ConnectOnlyAsync(objHandle: HCkFtp2): HCkTask; stdcall;

Creates an asynchronous task to call the ConnectOnly method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
ConvertToTls
function CkFtp2_ConvertToTls(objHandle: HCkFtp2): wordbool; stdcall;

Upgrades an already-connected clear FTP control channel to TLS. This method is intended for a manually staged connection created with ConnectOnly.

Do not call it when AuthTls or AuthSsl was enabled before connecting; those properties perform the upgrade automatically.

Returns True for success, False for failure.

top
ConvertToTlsAsync (1)
function CkFtp2_ConvertToTlsAsync(objHandle: HCkFtp2): HCkTask; stdcall;

Creates an asynchronous task to call the ConvertToTls method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
CreatePlan
function CkFtp2_CreatePlan(objHandle: HCkFtp2;
    localDir: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkFtp2__createPlan(objHandle: HCkFtp2;
    localDir: PWideChar): PWideChar; stdcall;

Creates and returns a textual upload plan for the local directory at localDir. The plan lists the operations that PutTree would perform and can later be executed by PutPlan.

Resumable bulk upload: PutPlan records completed operations in a log file. Reusing the plan and log after interruption allows already completed steps to be skipped.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
CreatePlanAsync (1)
function CkFtp2_CreatePlanAsync(objHandle: HCkFtp2;
    localDir: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the CreatePlan method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
CreateRemoteDir
function CkFtp2_CreateRemoteDir(objHandle: HCkFtp2;
    remoteDirPath: PWideChar): wordbool; stdcall;

Creates the remote directory at remoteDirPath by sending the server's directory-creation command. The path is interpreted relative to the current remote directory unless the server recognizes it as absolute.

If the directory already exists, the server commonly returns an error and the method fails.

Returns True for success, False for failure.

top
CreateRemoteDirAsync (1)
function CkFtp2_CreateRemoteDirAsync(objHandle: HCkFtp2;
    remoteDirPath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the CreateRemoteDir method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
DeleteMatching
function CkFtp2_DeleteMatching(objHandle: HCkFtp2;
    remotePattern: PWideChar): Integer; stdcall;

Deletes files in the current remote directory whose names match the wildcard pattern in remotePattern. The method returns the number deleted, or -1 if the operation fails.

* matches zero or more characters. Matching details may depend on the server because the remote listing operation is server-side.

top
DeleteMatchingAsync (1)
function CkFtp2_DeleteMatchingAsync(objHandle: HCkFtp2;
    remotePattern: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the DeleteMatching method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
DeleteRemoteFile
function CkFtp2_DeleteRemoteFile(objHandle: HCkFtp2;
    remoteFilePath: PWideChar): wordbool; stdcall;

Deletes the remote file at remoteFilePath. The path may be relative to the current remote directory or absolute according to the server's path syntax.

Returns True for success, False for failure.

top
DeleteRemoteFileAsync (1)
function CkFtp2_DeleteRemoteFileAsync(objHandle: HCkFtp2;
    remoteFilePath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the DeleteRemoteFile method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
DeleteTree
function CkFtp2_DeleteTree(objHandle: HCkFtp2): wordbool; stdcall;

Recursively deletes the files and subdirectories beneath the current remote directory and then removes directories as they become empty.

Destructive operation: Set the current remote directory carefully before calling this method. The VerifyDeleteFile and VerifyDeleteDir callbacks can set their skip output to prevent selected items from being deleted.

Returns True for success, False for failure.

More Information and Examples
top
DeleteTreeAsync (1)
function CkFtp2_DeleteTreeAsync(objHandle: HCkFtp2): HCkTask; stdcall;

Creates an asynchronous task to call the DeleteTree method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
DirTreeXml
function CkFtp2_DirTreeXml(objHandle: HCkFtp2;
    outStrXml: HCkString): wordbool; stdcall;
function CkFtp2__dirTreeXml(objHandle: HCkFtp2): PWideChar; stdcall;

Returns an XML representation of the complete remote directory tree rooted at the current remote directory. Traversal is affected by SyncMustMatch, SyncMustNotMatch, SyncMustMatchDir, and SyncMustNotMatchDir.

This method retrieves metadata; it does not download file content.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
DirTreeXmlAsync (1)
function CkFtp2_DirTreeXmlAsync(objHandle: HCkFtp2): HCkTask; stdcall;

Creates an asynchronous task to call the DirTreeXml method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
Disconnect
function CkFtp2_Disconnect(objHandle: HCkFtp2): wordbool; stdcall;

Ends the FTP session and closes the control connection. When possible, Chilkat sends the normal FTP quit command before closing the socket.

Returns True for success, False for failure.

top
DisconnectAsync (1)
function CkFtp2_DisconnectAsync(objHandle: HCkFtp2): HCkTask; stdcall;

Creates an asynchronous task to call the Disconnect method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
DownloadTree
function CkFtp2_DownloadTree(objHandle: HCkFtp2;
    localRoot: PWideChar): wordbool; stdcall;

Downloads all selected files and subdirectories beneath the current remote directory and recreates the tree under the local directory at localRoot.

The file and directory filters in SyncMustMatch, SyncMustNotMatch, SyncMustMatchDir, and SyncMustNotMatchDir apply. Use SetOldestDateStr to exclude files older than a chosen date.

Returns True for success, False for failure.

top
DownloadTreeAsync (1)
function CkFtp2_DownloadTreeAsync(objHandle: HCkFtp2;
    localRoot: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the DownloadTree method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
Feat
function CkFtp2_Feat(objHandle: HCkFtp2;
    outStr: HCkString): wordbool; stdcall;
function CkFtp2__feat(objHandle: HCkFtp2): PWideChar; stdcall;

Sends FEAT and returns the server's multiline capability reply. A server may return an error when the command is unsupported. Chilkat also performs capability discovery automatically when AutoFeat is enabled.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
FeatAsync (1)
function CkFtp2_FeatAsync(objHandle: HCkFtp2): HCkTask; stdcall;

Creates an asynchronous task to call the Feat method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetCreateTimeByNameStr
function CkFtp2_GetCreateTimeByNameStr(objHandle: HCkFtp2;
    filename: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkFtp2__getCreateTimeByNameStr(objHandle: HCkFtp2;
    filename: PWideChar): PWideChar; stdcall;

Returns the creation time for the file or directory named by filename in the current remote directory as an RFC 822 date-time string, such as Fri, 21 Nov 1997 09:55:06 -0600.

filename must be a name, not a path. Set the current remote directory first, and ensure ListPattern matches the name so the item is present in the cached listing.

Creation times: Many UNIX-like filesystems and FTP listing formats do not provide a file creation time. In that case the server or parser may report the modification time instead.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
GetCreateTimeByNameStrAsync (1)
function CkFtp2_GetCreateTimeByNameStrAsync(objHandle: HCkFtp2;
    filename: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the GetCreateTimeByNameStr method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetCreateTimeStr
function CkFtp2_GetCreateTimeStr(objHandle: HCkFtp2;
    index: Integer;
    outStr: HCkString): wordbool; stdcall;
function CkFtp2__getCreateTimeStr(objHandle: HCkFtp2;
    index: Integer): PWideChar; stdcall;

Returns the creation time for cached directory-listing entry index as an RFC 822 date-time string, such as Fri, 21 Nov 1997 09:55:06 -0600. index is a zero-based index from 0 through one less than GetDirCount. Creation-time availability depends on the server and listing format.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
GetCreateTimeStrAsync (1)
function CkFtp2_GetCreateTimeStrAsync(objHandle: HCkFtp2;
    index: Integer): HCkTask; stdcall;

Creates an asynchronous task to call the GetCreateTimeStr method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetCurrentRemoteDir
function CkFtp2_GetCurrentRemoteDir(objHandle: HCkFtp2;
    outStr: HCkString): wordbool; stdcall;
function CkFtp2__getCurrentRemoteDir(objHandle: HCkFtp2): PWideChar; stdcall;

Returns the current working directory reported by the FTP server, normally by using the PWD command.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
GetCurrentRemoteDirAsync (1)
function CkFtp2_GetCurrentRemoteDirAsync(objHandle: HCkFtp2): HCkTask; stdcall;

Creates an asynchronous task to call the GetCurrentRemoteDir method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetDirCount
function CkFtp2_GetDirCount(objHandle: HCkFtp2): Integer; stdcall;
Introduced in version 9.5.0.44

Returns the number of files and directories in the cached listing of the current remote directory after applying ListPattern. On the first call, Chilkat obtains and caches a listing; call ClearDirCache to force a refresh. Returns -1 if the listing cannot be obtained or parsed.

Directory listings use a data connection: An FTP listing is transferred over a separate data connection, just like an upload or download. If this method stalls, investigate passive/active mode, NAT, firewall rules, and the data-connection details in LastErrorText.

More Information and Examples
top
GetDirCountAsync (1)
function CkFtp2_GetDirCountAsync(objHandle: HCkFtp2): HCkTask; stdcall;
Introduced in version 9.5.0.44

Creates an asynchronous task to call the GetDirCount method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetFile
function CkFtp2_GetFile(objHandle: HCkFtp2;
    remoteFilePath: PWideChar;
    localFilePath: PWideChar): wordbool; stdcall;

Downloads the remote file at remoteFilePath to the local filesystem path at localFilePath. The local file is created or replaced according to the normal download behavior.

Use RestartNext immediately before this call to request resume of an existing partial file. ReadTimeout controls data-channel inactivity.

Returns True for success, False for failure.

top
GetFileAsync (1)
function CkFtp2_GetFileAsync(objHandle: HCkFtp2;
    remoteFilePath: PWideChar;
    localFilePath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the GetFile method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

More Information and Examples
top
GetFileBd
function CkFtp2_GetFileBd(objHandle: HCkFtp2;
    remoteFilePath: PWideChar;
    binData: HCkBinData): wordbool; stdcall;
Introduced in version 9.5.0.62

Downloads the remote file at remoteFilePath and places its bytes in the BinData object in binData. No text decoding or line-ending conversion is performed.

Returns True for success, False for failure.

More Information and Examples
top
GetFileBdAsync (1)
function CkFtp2_GetFileBdAsync(objHandle: HCkFtp2;
    remoteFilePath: PWideChar;
    binData: HCkBinData): HCkTask; stdcall;
Introduced in version 9.5.0.62

Creates an asynchronous task to call the GetFileBd method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetFilename
function CkFtp2_GetFilename(objHandle: HCkFtp2;
    index: Integer;
    outStr: HCkString): wordbool; stdcall;
function CkFtp2__getFilename(objHandle: HCkFtp2;
    index: Integer): PWideChar; stdcall;

Returns the name of cached directory-listing entry index. index is a zero-based index from 0 through one less than GetDirCount. The returned value is the name from the listing, not necessarily a full remote path.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
GetFilenameAsync (1)
function CkFtp2_GetFilenameAsync(objHandle: HCkFtp2;
    index: Integer): HCkTask; stdcall;

Creates an asynchronous task to call the GetFilename method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetFileSb
function CkFtp2_GetFileSb(objHandle: HCkFtp2;
    remoteFilePath: PWideChar;
    charset: PWideChar;
    sb: HCkStringBuilder): wordbool; stdcall;
Introduced in version 9.5.0.62

Downloads the remote file at remoteFilePath, decodes its bytes using the charset named by charset, and places the resulting text in the StringBuilder in sb.

Returns True for success, False for failure.

More Information and Examples
top
GetFileSbAsync (1)
function CkFtp2_GetFileSbAsync(objHandle: HCkFtp2;
    remoteFilePath: PWideChar;
    charset: PWideChar;
    sb: HCkStringBuilder): HCkTask; stdcall;
Introduced in version 9.5.0.62

Creates an asynchronous task to call the GetFileSb method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetFileToStream
function CkFtp2_GetFileToStream(objHandle: HCkFtp2;
    remoteFilePath: PWideChar;
    toStream: HCkStream): wordbool; stdcall;
Introduced in version 9.5.0.67

Downloads the remote file at remoteFilePath and writes its bytes to the Stream in toStream.

For a synchronous call, toStream must be configured with a destination sink before the method begins. For an asynchronous call, application code may read from the stream while the background download produces data.

Returns True for success, False for failure.

More Information and Examples
top
GetFileToStreamAsync (1)
function CkFtp2_GetFileToStreamAsync(objHandle: HCkFtp2;
    remoteFilePath: PWideChar;
    toStream: HCkStream): HCkTask; stdcall;
Introduced in version 9.5.0.67

Creates an asynchronous task to call the GetFileToStream method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetGroup
function CkFtp2_GetGroup(objHandle: HCkFtp2;
    index: Integer;
    outStr: HCkString): wordbool; stdcall;
function CkFtp2__getGroup(objHandle: HCkFtp2;
    index: Integer): PWideChar; stdcall;
Introduced in version 9.5.0.50

Returns the group name or identifier for cached directory-listing entry index. The value is empty when the server does not provide group metadata.

MLSD metadata: MLSD commonly provides accurate size and time facts but often omits owner and group. On a UNIX-like server, disabling AllowMlsd may expose owner/group through LIST, at the cost of less standardized and potentially less accurate listing data.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
GetGroupAsync (1)
function CkFtp2_GetGroupAsync(objHandle: HCkFtp2;
    index: Integer): HCkTask; stdcall;
Introduced in version 9.5.0.50

Creates an asynchronous task to call the GetGroup method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetIsDirectory
function CkFtp2_GetIsDirectory(objHandle: HCkFtp2;
    index: Integer): wordbool; stdcall;

Returns True when cached directory-listing entry index is identified as a directory. index is a zero-based index into the current cached listing.

top
GetIsDirectoryAsync (1)
function CkFtp2_GetIsDirectoryAsync(objHandle: HCkFtp2;
    index: Integer): HCkTask; stdcall;

Creates an asynchronous task to call the GetIsDirectory method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetIsSymbolicLink
function CkFtp2_GetIsSymbolicLink(objHandle: HCkFtp2;
    index: Integer): wordbool; stdcall;

Returns True when cached directory-listing entry index is identified as a symbolic link. This information is available only when the server's listing format reports it.

top
GetIsSymbolicLinkAsync (1)
function CkFtp2_GetIsSymbolicLinkAsync(objHandle: HCkFtp2;
    index: Integer): HCkTask; stdcall;

Creates an asynchronous task to call the GetIsSymbolicLink method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetLastJsonData
procedure CkFtp2_GetLastJsonData(objHandle: HCkFtp2;
    json: HCkJsonObject) stdcall;
Introduced in version 11.5.0

Copies JSON details from the most recent method call into the JsonObject in json. Only methods that produce structured supplemental information populate this data; otherwise the object may remain empty. Call this method immediately after the operation whose details are needed.

Returns True for success, False for failure.

top
GetLastModifiedTimeByNameStr
function CkFtp2_GetLastModifiedTimeByNameStr(objHandle: HCkFtp2;
    filename: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkFtp2__getLastModifiedTimeByNameStr(objHandle: HCkFtp2;
    filename: PWideChar): PWideChar; stdcall;

Returns the last-modified time for the item named by filename in the current remote directory as an RFC 822 date-time string, such as Fri, 21 Nov 1997 09:55:06 -0600.

filename must be a name, not a path. Set the current remote directory first, and ensure ListPattern matches the name.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
GetLastModifiedTimeByNameStrAsync (1)
function CkFtp2_GetLastModifiedTimeByNameStrAsync(objHandle: HCkFtp2;
    filename: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the GetLastModifiedTimeByNameStr method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetLastModifiedTimeStr
function CkFtp2_GetLastModifiedTimeStr(objHandle: HCkFtp2;
    index: Integer;
    outStr: HCkString): wordbool; stdcall;
function CkFtp2__getLastModifiedTimeStr(objHandle: HCkFtp2;
    index: Integer): PWideChar; stdcall;

Returns the last-modified time for cached directory-listing entry index as an RFC 822 date-time string, such as Fri, 21 Nov 1997 09:55:06 -0600. index is a zero-based index into the current cached listing.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
GetLastModifiedTimeStrAsync (1)
function CkFtp2_GetLastModifiedTimeStrAsync(objHandle: HCkFtp2;
    index: Integer): HCkTask; stdcall;

Creates an asynchronous task to call the GetLastModifiedTimeStr method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetOwner
function CkFtp2_GetOwner(objHandle: HCkFtp2;
    index: Integer;
    outStr: HCkString): wordbool; stdcall;
function CkFtp2__getOwner(objHandle: HCkFtp2;
    index: Integer): PWideChar; stdcall;
Introduced in version 9.5.0.50

Returns the owner name or identifier for cached directory-listing entry index. The value is empty when the server does not provide owner metadata.

MLSD metadata: MLSD commonly provides accurate size and time facts but often omits owner and group. On a UNIX-like server, disabling AllowMlsd may expose owner/group through LIST, at the cost of less standardized and potentially less accurate listing data.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
GetOwnerAsync (1)
function CkFtp2_GetOwnerAsync(objHandle: HCkFtp2;
    index: Integer): HCkTask; stdcall;
Introduced in version 9.5.0.50

Creates an asynchronous task to call the GetOwner method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetPermissions
function CkFtp2_GetPermissions(objHandle: HCkFtp2;
    index: Integer;
    outStr: HCkString): wordbool; stdcall;
function CkFtp2__getPermissions(objHandle: HCkFtp2;
    index: Integer): PWideChar; stdcall;
Introduced in version 9.5.0.50

Returns the permissions or status string for cached directory-listing entry index. The value is empty when the server provides no such metadata. Use GetPermType to determine how to interpret the result.

Permission typeReturned information
mlsdThe RFC 3659 perm fact. Letters describe FTP operations available to the logged-in user, such as append, create, delete, enter, list, rename, or write.
unixA UNIX-style string such as rwxr-xr-x.
netwareNetWare trustee-right letters such as read, write, create, erase, modify, file scan, access control, and supervisor.
openvmsAn OpenVMS protection string such as (RWED,RWED,R,R).
batchStatusFlagsA fixed-position Connect:Enterprise batch-status string such as -CR--M----.
MLSD perm is not a file mode: The MLSD perm fact describes operations the current FTP account may perform. It is not equivalent to UNIX owner/group/other permission bits.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
GetPermissionsAsync (1)
function CkFtp2_GetPermissionsAsync(objHandle: HCkFtp2;
    index: Integer): HCkTask; stdcall;
Introduced in version 9.5.0.50

Creates an asynchronous task to call the GetPermissions method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetPermType
function CkFtp2_GetPermType(objHandle: HCkFtp2;
    index: Integer;
    outStr: HCkString): wordbool; stdcall;
function CkFtp2__getPermType(objHandle: HCkFtp2;
    index: Integer): PWideChar; stdcall;
Introduced in version 9.5.0.50

Returns the format identifier for the permissions string available for cached listing entry index. The value is empty when no permissions are available.

ValueFormat
mlsdThe RFC 3659 perm fact.
unixA UNIX/POSIX-style mode string.
netwareNetWare trustee rights.
openvmsAn OpenVMS protection string.
batchStatusFlagsConnect:Enterprise batch status flags.

Use GetPermissions to obtain the corresponding value.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
GetPermTypeAsync (1)
function CkFtp2_GetPermTypeAsync(objHandle: HCkFtp2;
    index: Integer): HCkTask; stdcall;
Introduced in version 9.5.0.50

Creates an asynchronous task to call the GetPermType method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetRemoteFileTextC
function CkFtp2_GetRemoteFileTextC(objHandle: HCkFtp2;
    remoteFilename: PWideChar;
    charset: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkFtp2__getRemoteFileTextC(objHandle: HCkFtp2;
    remoteFilename: PWideChar;
    charset: PWideChar): PWideChar; stdcall;

Downloads the remote file at remoteFilename, decodes its bytes using the character encoding named by charset, and returns the resulting text.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
GetRemoteFileTextCAsync (1)
function CkFtp2_GetRemoteFileTextCAsync(objHandle: HCkFtp2;
    remoteFilename: PWideChar;
    charset: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the GetRemoteFileTextC method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetRemoteFileTextData
function CkFtp2_GetRemoteFileTextData(objHandle: HCkFtp2;
    remoteFilename: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkFtp2__getRemoteFileTextData(objHandle: HCkFtp2;
    remoteFilename: PWideChar): PWideChar; stdcall;

Downloads the remote file at remoteFilename and returns its contents decoded using the ANSI character encoding. Use GetRemoteFileTextC when the file uses UTF-8 or another explicitly known encoding.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
GetRemoteFileTextDataAsync (1)
function CkFtp2_GetRemoteFileTextDataAsync(objHandle: HCkFtp2;
    remoteFilename: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the GetRemoteFileTextData method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetServerCert
function CkFtp2_GetServerCert(objHandle: HCkFtp2;
    cert: HCkCert): wordbool; stdcall;
Introduced in version 11.0.0

Loads into the Cert object in cert the certificate presented by the FTP server during the current or most recent TLS connection.

Returns True for success, False for failure.

top
GetSize
function CkFtp2_GetSize(objHandle: HCkFtp2;
    index: Integer): Integer; stdcall;

Returns the size in bytes of cached directory-listing entry index as a 32-bit integer. Use GetSize64 for large files. A negative value indicates that the size is unavailable or the operation failed.

top
GetSizeAsync (1)
function CkFtp2_GetSizeAsync(objHandle: HCkFtp2;
    index: Integer): HCkTask; stdcall;

Creates an asynchronous task to call the GetSize method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetSize64
function CkFtp2_GetSize64(objHandle: HCkFtp2;
    index: Integer): Int64; stdcall;

Returns the size in bytes of cached directory-listing entry index as a 64-bit integer. Returns -1 when the size is unavailable or the operation fails.

top
GetSize64Async (1)
function CkFtp2_GetSize64Async(objHandle: HCkFtp2;
    index: Integer): HCkTask; stdcall;

Creates an asynchronous task to call the GetSize64 method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetSizeByName
function CkFtp2_GetSizeByName(objHandle: HCkFtp2;
    filename: PWideChar): Integer; stdcall;

Returns the size in bytes of the file named by filename in the current remote directory as a 32-bit integer. Returns -1 when the file is not found or the size cannot be obtained. Use GetSizeByName64 for large files.

filename must be a name, not a path. Set the current remote directory first, and ensure ListPattern matches the name.

top
GetSizeByNameAsync (1)
function CkFtp2_GetSizeByNameAsync(objHandle: HCkFtp2;
    filename: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the GetSizeByName method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetSizeByName64
function CkFtp2_GetSizeByName64(objHandle: HCkFtp2;
    filename: PWideChar): Int64; stdcall;

Returns the size in bytes of the file named by filename in the current remote directory as a 64-bit integer. Returns -1 when the file is not found or the size cannot be obtained.

filename must be a name, not a path. Set the current remote directory first, and ensure ListPattern matches the name.

top
GetSizeByName64Async (1)
function CkFtp2_GetSizeByName64Async(objHandle: HCkFtp2;
    filename: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the GetSizeByName64 method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetSizeStr
function CkFtp2_GetSizeStr(objHandle: HCkFtp2;
    index: Integer;
    outStr: HCkString): wordbool; stdcall;
function CkFtp2__getSizeStr(objHandle: HCkFtp2;
    index: Integer): PWideChar; stdcall;

Returns the size in bytes of cached directory-listing entry index as a decimal string. This form avoids integer-size limits in languages without a convenient 64-bit type.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
GetSizeStrAsync (1)
function CkFtp2_GetSizeStrAsync(objHandle: HCkFtp2;
    index: Integer): HCkTask; stdcall;

Creates an asynchronous task to call the GetSizeStr method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetSizeStrByName
function CkFtp2_GetSizeStrByName(objHandle: HCkFtp2;
    filename: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkFtp2__getSizeStrByName(objHandle: HCkFtp2;
    filename: PWideChar): PWideChar; stdcall;

Returns the size in bytes of the file named by filename in the current remote directory as a decimal string. This form avoids language-specific integer limits.

filename must be a name, not a path. Set the current remote directory first, and ensure ListPattern matches the name.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
GetSizeStrByNameAsync (1)
function CkFtp2_GetSizeStrByNameAsync(objHandle: HCkFtp2;
    filename: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the GetSizeStrByName method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetSyncedFiles
procedure CkFtp2_GetSyncedFiles(objHandle: HCkFtp2;
    strTable: HCkStringTable) stdcall;
Introduced in version 10.0.0

Appends to the StringTable in strTable the relative paths affected by the most recent synchronization operation. This includes files uploaded, downloaded, or deleted by SyncDeleteRemote, SyncLocalDir, SyncLocalTree, SyncRemoteTree, or SyncRemoteTree2.

top
GetTextDirListing
function CkFtp2_GetTextDirListing(objHandle: HCkFtp2;
    pattern: PWideChar;
    outStrRawListing: HCkString): wordbool; stdcall;
function CkFtp2__getTextDirListing(objHandle: HCkFtp2;
    pattern: PWideChar): PWideChar; stdcall;

Sends a directory-listing request for pattern and returns the server's raw textual listing. pattern may be a wildcard pattern or other argument accepted by the server.

The format of LIST output is server-specific; use the indexed listing methods or GetXmlDirListing when parsed metadata is preferred.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
GetTextDirListingAsync (1)
function CkFtp2_GetTextDirListingAsync(objHandle: HCkFtp2;
    pattern: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the GetTextDirListing method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetXmlDirListing
function CkFtp2_GetXmlDirListing(objHandle: HCkFtp2;
    pattern: PWideChar;
    outStrXmlListing: HCkString): wordbool; stdcall;
function CkFtp2__getXmlDirListing(objHandle: HCkFtp2;
    pattern: PWideChar): PWideChar; stdcall;

Retrieves a directory listing for pattern and returns the parsed entries as XML. pattern may be a wildcard pattern accepted by the server. The metadata available depends on whether the server provides MLSD facts or a parseable legacy listing.

Timestamp interpretation: Returned last-modified values are expressed in the client's local time. Legacy FTP listings may omit timezone information, so exact conversion can be impossible when the server timezone is unknown.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
GetXmlDirListingAsync (1)
function CkFtp2_GetXmlDirListingAsync(objHandle: HCkFtp2;
    pattern: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the GetXmlDirListing method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
LargeFileUpload
function CkFtp2_LargeFileUpload(objHandle: HCkFtp2;
    localPath: PWideChar;
    remotePath: PWideChar;
    chunkSize: Integer): wordbool; stdcall;
Introduced in version 9.5.0.58

Uploads the local file at localPath to the remote path at remotePath as a sequence of append operations, each containing up to chunkSize bytes.

This method addresses a specific FTP failure mode: during one very long data transfer, the control connection is idle and may be silently dropped by a firewall, NAT device, or server timeout. Completing the upload as multiple shorter transfers periodically uses the control channel.

chunkSize is the in-memory chunk size. Larger chunks reduce FTP command overhead but consume more memory and leave the control channel idle longer; smaller chunks have the opposite tradeoff.

Alternative: For ordinary large files, first consider enabling LargeFileMeasures. Use chunked upload when infrastructure still drops the idle control session.

Returns True for success, False for failure.

More Information and Examples
top
LargeFileUploadAsync (1)
function CkFtp2_LargeFileUploadAsync(objHandle: HCkFtp2;
    localPath: PWideChar;
    remotePath: PWideChar;
    chunkSize: Integer): HCkTask; stdcall;
Introduced in version 9.5.0.58

Creates an asynchronous task to call the LargeFileUpload method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
LoadTaskCaller
function CkFtp2_LoadTaskCaller(objHandle: HCkFtp2;
    task: HCkTask): wordbool; stdcall;
Introduced in version 9.5.0.80

Loads the original caller object associated with the asynchronous Task in task. This is an internal support method for Chilkat's task infrastructure and is not normally needed by application code.

Returns True for success, False for failure.

top
LoginAfterConnectOnly
function CkFtp2_LoginAfterConnectOnly(objHandle: HCkFtp2): wordbool; stdcall;

Authenticates an FTP session previously established by ConnectOnly, using Username, Password, and Account. Together, ConnectOnly and this method perform the connection and login stages of Connect.

After authentication, Chilkat performs the configured automatic capability and system queries. Set AutoFeat or AutoSyst to False to suppress those commands.

Returns True for success, False for failure.

top
LoginAfterConnectOnlyAsync (1)
function CkFtp2_LoginAfterConnectOnlyAsync(objHandle: HCkFtp2): HCkTask; stdcall;

Creates an asynchronous task to call the LoginAfterConnectOnly method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
MGetFiles
function CkFtp2_MGetFiles(objHandle: HCkFtp2;
    remotePattern: PWideChar;
    localDir: PWideChar): Integer; stdcall;

Downloads files in the current remote directory that match remotePattern into the local directory at localDir. Subdirectories are not traversed. The method returns the number of files downloaded, or -1 on failure.

Wildcard matching is performed by the FTP server's listing command and may be case-sensitive or case-insensitive according to the remote server and filesystem.

More Information and Examples
top
MGetFilesAsync (1)
function CkFtp2_MGetFilesAsync(objHandle: HCkFtp2;
    remotePattern: PWideChar;
    localDir: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the MGetFiles method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
MPutFiles
function CkFtp2_MPutFiles(objHandle: HCkFtp2;
    pattern: PWideChar): Integer; stdcall;

Uploads each local file matching pattern to the current remote directory. pattern may include a local directory and wildcard, such as C:/data/*.txt. Subdirectories are not traversed.

The method returns the number of files uploaded, or -1 on failure.

top
MPutFilesAsync (1)
function CkFtp2_MPutFilesAsync(objHandle: HCkFtp2;
    pattern: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the MPutFiles method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
NlstXml
function CkFtp2_NlstXml(objHandle: HCkFtp2;
    remoteDirPattern: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkFtp2__nlstXml(objHandle: HCkFtp2;
    remoteDirPattern: PWideChar): PWideChar; stdcall;

Sends NLST with remoteDirPattern and returns the names in XML form. remoteDirPattern may be a pattern such as *, *.txt, or subdir/*.xml.

<nlst>
  <e>name1</e>
  <e>name2</e>
</nlst>

NLST normally returns names only; it does not provide reliable sizes, times, or permissions.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
NlstXmlAsync (1)
function CkFtp2_NlstXmlAsync(objHandle: HCkFtp2;
    remoteDirPattern: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the NlstXml method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
Noop
function CkFtp2_Noop(objHandle: HCkFtp2): wordbool; stdcall;

Sends the FTP NOOP command. This can test whether the control session is still responsive or keep an otherwise idle control connection active.

Returns True for success, False for failure.

top
NoopAsync (1)
function CkFtp2_NoopAsync(objHandle: HCkFtp2): HCkTask; stdcall;

Creates an asynchronous task to call the Noop method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
PutFile
function CkFtp2_PutFile(objHandle: HCkFtp2;
    localFilePath: PWideChar;
    remoteFilePath: PWideChar): wordbool; stdcall;

Uploads the local filesystem file at localFilePath to the remote path at remoteFilePath. The remote file is created or replaced according to server behavior.

Use RestartNext immediately before this call to request resume of an existing partial remote file. IdleTimeoutMs limits how long the upload may remain blocked without forward progress.

Returns True for success, False for failure.

top
PutFileAsync (1)
function CkFtp2_PutFileAsync(objHandle: HCkFtp2;
    localFilePath: PWideChar;
    remoteFilePath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the PutFile method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

More Information and Examples
top
PutFileBd
function CkFtp2_PutFileBd(objHandle: HCkFtp2;
    binData: HCkBinData;
    remoteFilePath: PWideChar): wordbool; stdcall;
Introduced in version 9.5.0.62

Uploads the bytes contained in the BinData object in binData to the remote path at remoteFilePath. No character encoding or line-ending conversion is performed.

Returns True for success, False for failure.

More Information and Examples
top
PutFileBdAsync (1)
function CkFtp2_PutFileBdAsync(objHandle: HCkFtp2;
    binData: HCkBinData;
    remoteFilePath: PWideChar): HCkTask; stdcall;
Introduced in version 9.5.0.62

Creates an asynchronous task to call the PutFileBd method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
PutFileFromTextData
function CkFtp2_PutFileFromTextData(objHandle: HCkFtp2;
    remoteFilename: PWideChar;
    textData: PWideChar;
    charset: PWideChar): wordbool; stdcall;

Encodes the text in textData using the character encoding named by charset and uploads the resulting bytes to the remote file at remoteFilename.

charset controls the file content encoding. Remote filename encoding is controlled separately by CommandCharset.

Returns True for success, False for failure.

More Information and Examples
top
PutFileFromTextDataAsync (1)
function CkFtp2_PutFileFromTextDataAsync(objHandle: HCkFtp2;
    remoteFilename: PWideChar;
    textData: PWideChar;
    charset: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the PutFileFromTextData method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
PutFileSb
function CkFtp2_PutFileSb(objHandle: HCkFtp2;
    sb: HCkStringBuilder;
    charset: PWideChar;
    includeBom: wordbool;
    remoteFilePath: PWideChar): wordbool; stdcall;
Introduced in version 9.5.0.62

Encodes the text in the StringBuilder sb using the charset named by charset and uploads it to the remote path at remoteFilePath. When includeBom is True, a byte-order mark is included when the selected encoding defines one.

Returns True for success, False for failure.

More Information and Examples
top
PutFileSbAsync (1)
function CkFtp2_PutFileSbAsync(objHandle: HCkFtp2;
    sb: HCkStringBuilder;
    charset: PWideChar;
    includeBom: wordbool;
    remoteFilePath: PWideChar): HCkTask; stdcall;
Introduced in version 9.5.0.62

Creates an asynchronous task to call the PutFileSb method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
PutPlan
function CkFtp2_PutPlan(objHandle: HCkFtp2;
    plan: PWideChar;
    alreadyDoneFilename: PWideChar): wordbool; stdcall;

Executes the upload plan in plan. alreadyDoneFilename is the local path of a completion log; each successful plan operation is recorded there.

To resume an interrupted plan, call this method again with the same plan and log path. Operations already recorded as complete are skipped.

Log durability: Store the completion log on reliable local storage and do not edit it while the plan is running.

Returns True for success, False for failure.

More Information and Examples
top
PutPlanAsync (1)
function CkFtp2_PutPlanAsync(objHandle: HCkFtp2;
    plan: PWideChar;
    alreadyDoneFilename: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the PutPlan method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
PutTree
function CkFtp2_PutTree(objHandle: HCkFtp2;
    localDir: PWideChar): wordbool; stdcall;

Uploads the local directory tree rooted at localDir into the current remote directory, creating remote subdirectories as needed. The contents of localDir become children of the current remote directory.

Returns True for success, False for failure.

top
PutTreeAsync (1)
function CkFtp2_PutTreeAsync(objHandle: HCkFtp2;
    localDir: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the PutTree method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
Quote
function CkFtp2_Quote(objHandle: HCkFtp2;
    cmd: PWideChar): wordbool; stdcall;

Sends the raw FTP command text in cmd to the server. Use this for a command not otherwise exposed by the API.

cmd should contain the command and parameters but not the terminating CRLF. The method does not parse command-specific semantics.

Returns True for success, False for failure.

More Information and Examples
top
QuoteAsync (1)
function CkFtp2_QuoteAsync(objHandle: HCkFtp2;
    cmd: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the Quote method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
RemoveRemoteDir
function CkFtp2_RemoveRemoteDir(objHandle: HCkFtp2;
    remoteDirPath: PWideChar): wordbool; stdcall;

Removes the remote directory at remoteDirPath. FTP servers generally require the directory to be empty before it can be removed.

Returns True for success, False for failure.

top
RemoveRemoteDirAsync (1)
function CkFtp2_RemoveRemoteDirAsync(objHandle: HCkFtp2;
    remoteDirPath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the RemoveRemoteDir method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
RenameRemoteFile
function CkFtp2_RenameRemoteFile(objHandle: HCkFtp2;
    existingRemoteFilePath: PWideChar;
    newRemoteFilePath: PWideChar): wordbool; stdcall;

Renames or moves a remote file or directory from existingRemoteFilePath to newRemoteFilePath using the FTP rename sequence. Include directory components in newRemoteFilePath to move the item within the same FTP server.

Returns True for success, False for failure.

top
RenameRemoteFileAsync (1)
function CkFtp2_RenameRemoteFileAsync(objHandle: HCkFtp2;
    existingRemoteFilePath: PWideChar;
    newRemoteFilePath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the RenameRemoteFile method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
SendCommand
function CkFtp2_SendCommand(objHandle: HCkFtp2;
    cmd: PWideChar;
    outReply: HCkString): wordbool; stdcall;
function CkFtp2__sendCommand(objHandle: HCkFtp2;
    cmd: PWideChar): PWideChar; stdcall;

Sends the raw FTP command in cmd and returns the complete server reply. Use this when the reply text is required directly. cmd should not include the terminating CRLF.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
SendCommandAsync (1)
function CkFtp2_SendCommandAsync(objHandle: HCkFtp2;
    cmd: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the SendCommand method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
SetModeZ
function CkFtp2_SetModeZ(objHandle: HCkFtp2): wordbool; stdcall;

Enables MODE Z compression for subsequent data connections. Call this after connecting and only when HasModeZ is True. Uploads, downloads, and directory listings are then transferred through a DEFLATE-compressed stream.

Performance tradeoff: Compression can reduce network traffic for text and other compressible data, but may increase CPU usage and provide little benefit for already-compressed formats such as ZIP, JPEG, or MP4.

Returns True for success, False for failure.

top
SetModeZAsync (1)
function CkFtp2_SetModeZAsync(objHandle: HCkFtp2): HCkTask; stdcall;

Creates an asynchronous task to call the SetModeZ method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
SetOldestDateStr
procedure CkFtp2_SetOldestDateStr(objHandle: HCkFtp2;
    oldestDateTimeStr: PWideChar) stdcall;

Sets the oldest remote modification time eligible for the next DownloadTree operation. oldestDateTimeStr is an RFC 822 date-time string, such as Fri, 21 Nov 1997 09:55:06 -0600. Files older than this value are skipped.

top
SetOption
function CkFtp2_SetOption(objHandle: HCkFtp2;
    option: PWideChar): wordbool; stdcall;
Introduced in version 9.5.0.57

Enables or disables a named compatibility option. option identifies the option; prefix the name with No- to disable it.

The recognized option Microsoft-TLS-1.2-Workaround changes data-channel TLS behavior for compatibility with an old Microsoft FTP server defect. It weakens protocol selection and should be used only for the affected legacy server.

Returns True for success, False for failure.

top
SetRemoteFileDateTimeStr
function CkFtp2_SetRemoteFileDateTimeStr(objHandle: HCkFtp2;
    dateTimeStr: PWideChar;
    remoteFilename: PWideChar): wordbool; stdcall;

Sets the last-modified time of the remote file at remoteFilename. dateTimeStr is an RFC 822 date-time string, such as Fri, 21 Nov 1997 09:55:06 -0600.

FTP has no universally supported standard command for changing a file timestamp; success depends on server extensions and permissions.

Returns True for success, False for failure.

top
SetRemoteFileDateTimeStrAsync (1)
function CkFtp2_SetRemoteFileDateTimeStrAsync(objHandle: HCkFtp2;
    dateTimeStr: PWideChar;
    remoteFilename: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the SetRemoteFileDateTimeStr method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
SetRemoteFileDt
function CkFtp2_SetRemoteFileDt(objHandle: HCkFtp2;
    dt: HCkDateTime;
    remoteFilename: PWideChar): wordbool; stdcall;

Sets the last-modified time of the remote file at remoteFilename from the DateTime object in dt.

FTP has no universally supported standard command for changing a file timestamp; success depends on server extensions and permissions.

Returns True for success, False for failure.

top
SetRemoteFileDtAsync (1)
function CkFtp2_SetRemoteFileDtAsync(objHandle: HCkFtp2;
    dt: HCkDateTime;
    remoteFilename: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the SetRemoteFileDt method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
SetSecurePassword
function CkFtp2_SetSecurePassword(objHandle: HCkFtp2;
    password: HCkSecureString): wordbool; stdcall;
Introduced in version 9.5.0.76

Copies the password from the SecureString in password for subsequent FTP authentication. This avoids exposing the password as an ordinary immutable language string. It is equivalent to setting Password for login behavior.

Returns True for success, False for failure.

top
SetSslCertRequirement
procedure CkFtp2_SetSslCertRequirement(objHandle: HCkFtp2;
    reqName: PWideChar;
    reqValue: PWideChar) stdcall;

Adds a required match against the FTP server certificate. reqName selects the certificate field and reqValue specifies the required value. Supported field names include SubjectDN, SubjectCN, IssuerDN, IssuerCN, and SAN. Wildcards may be used in reqValue.

The TLS connection is rejected when the presented certificate does not satisfy the requirement.

Additional check: Certificate requirements supplement normal certificate validation; they should not be used as a substitute for trust-chain, validity, and hostname verification.

top
SetSslClientCert
function CkFtp2_SetSslClientCert(objHandle: HCkFtp2;
    cert: HCkCert): wordbool; stdcall;

Configures the Cert in cert as the client certificate for FTPS servers that request mutual TLS authentication. The certificate must have access to its private key.

Returns True for success, False for failure.

top
SetSslClientCertPem
function CkFtp2_SetSslClientCertPem(objHandle: HCkFtp2;
    pemDataOrFilename: PWideChar;
    pemPassword: PWideChar): wordbool; stdcall;

Configures a client certificate and private key from PEM data or a PEM file. pemDataOrFilename may contain the PEM text or the local filesystem path of a PEM file. pemPassword is the private-key password, or an empty string when the key is not encrypted.

Returns True for success, False for failure.

top
SetSslClientCertPfx
function CkFtp2_SetSslClientCertPfx(objHandle: HCkFtp2;
    pfxFilename: PWideChar;
    pfxPassword: PWideChar): wordbool; stdcall;

Loads a client certificate and private key from the local PFX/P12 file at pfxFilename. pfxPassword is the file password. The certificate is used when the FTPS server requests mutual TLS authentication.

Returns True for success, False for failure.

top
SetTypeAscii
function CkFtp2_SetTypeAscii(objHandle: HCkFtp2): wordbool; stdcall;

Sets the FTP representation type to ASCII for subsequent transfers. In ASCII mode, the FTP endpoints may translate line endings, and CrlfMode can apply additional conversion on downloads.

Use carefully: ASCII mode is intended for text. Use SetTypeBinary for executables, archives, images, encrypted data, and any file whose bytes must remain unchanged.

Returns True for success, False for failure.

top
SetTypeAsciiAsync (1)
function CkFtp2_SetTypeAsciiAsync(objHandle: HCkFtp2): HCkTask; stdcall;

Creates an asynchronous task to call the SetTypeAscii method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
SetTypeBinary
function CkFtp2_SetTypeBinary(objHandle: HCkFtp2): wordbool; stdcall;

Sets the FTP representation type to binary (TYPE I) for subsequent transfers. Binary mode preserves file bytes and is the appropriate default for nearly all modern file types.

Returns True for success, False for failure.

top
SetTypeBinaryAsync (1)
function CkFtp2_SetTypeBinaryAsync(objHandle: HCkFtp2): HCkTask; stdcall;

Creates an asynchronous task to call the SetTypeBinary method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
Site
function CkFtp2_Site(objHandle: HCkFtp2;
    siteCommand: PWideChar): wordbool; stdcall;

Sends a server-specific SITE command. siteCommand contains the text following SITE, for example RECFM=FB LRECL=600.

SITE subcommands are defined by the server, not by the FTP standard, and may require special permissions.

Returns True for success, False for failure.

top
SiteAsync (1)
function CkFtp2_SiteAsync(objHandle: HCkFtp2;
    siteCommand: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the Site method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
SleepMs
procedure CkFtp2_SleepMs(objHandle: HCkFtp2;
    millisec: Integer) stdcall;

Blocks the calling thread for millisec milliseconds. This is a utility method and performs no FTP network operation.

top
Stat
function CkFtp2_Stat(objHandle: HCkFtp2;
    outStr: HCkString): wordbool; stdcall;
function CkFtp2__stat(objHandle: HCkFtp2): PWideChar; stdcall;

Sends the FTP STAT command and returns the server's reply. Depending on the server and session state, the reply may contain status information or a directory listing.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
StatAsync (1)
function CkFtp2_StatAsync(objHandle: HCkFtp2): HCkTask; stdcall;

Creates an asynchronous task to call the Stat method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
SyncDeleteRemote
function CkFtp2_SyncDeleteRemote(objHandle: HCkFtp2;
    localRoot: PWideChar): wordbool; stdcall;

Recursively compares the remote tree rooted at the current remote directory with the local tree rooted at localRoot and deletes remote files that have no corresponding local file.

Destructive synchronization: This method deletes server data. Verify the current remote directory, local root, and synchronization filters before calling it.

Use GetSyncedFiles after the call to obtain the relative paths deleted.

Returns True for success, False for failure.

top
SyncDeleteRemoteAsync (1)
function CkFtp2_SyncDeleteRemoteAsync(objHandle: HCkFtp2;
    localRoot: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the SyncDeleteRemote method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
SyncLocalDir
function CkFtp2_SyncLocalDir(objHandle: HCkFtp2;
    localRoot: PWideChar;
    mode: Integer): wordbool; stdcall;

Synchronizes files from the current remote directory into the local directory at localRoot without descending into subdirectories. mode selects the same download mode documented for SyncLocalTree. Use GetSyncedFiles afterward to obtain the affected relative paths.

Returns True for success, False for failure.

More Information and Examples
top
SyncLocalDirAsync (1)
function CkFtp2_SyncLocalDirAsync(objHandle: HCkFtp2;
    localRoot: PWideChar;
    mode: Integer): HCkTask; stdcall;

Creates an asynchronous task to call the SyncLocalDir method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
SyncLocalTree
function CkFtp2_SyncLocalTree(objHandle: HCkFtp2;
    localRoot: PWideChar;
    mode: Integer): wordbool; stdcall;

Synchronizes the remote tree rooted at the current remote directory into the local directory at localRoot. mode selects which files are downloaded or deleted.

ModeAction
0Download all selected files.
1Download files missing locally.
2Download files that are missing locally or newer on the server.
3Download only files that already exist locally and are newer on the server.
5Download files that are missing locally or have a different size.
6Download files that are missing, have a different size, or are newer on the server.
99Do not download; delete remote files that do not exist locally.

The synchronization filters apply, and GetSyncedFiles returns the relative paths affected by the operation.

Time comparison: Newer-file modes depend on remote timestamps and local clock interpretation. Size-based modes may be more predictable when server timestamp precision is limited.

Returns True for success, False for failure.

More Information and Examples
top
SyncLocalTreeAsync (1)
function CkFtp2_SyncLocalTreeAsync(objHandle: HCkFtp2;
    localRoot: PWideChar;
    mode: Integer): HCkTask; stdcall;

Creates an asynchronous task to call the SyncLocalTree method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
SyncRemoteTree
function CkFtp2_SyncRemoteTree(objHandle: HCkFtp2;
    localRoot: PWideChar;
    mode: Integer): wordbool; stdcall;

Synchronizes the local tree rooted at localRoot into the current remote directory. mode selects which files are uploaded.

ModeAction
0Upload all selected files.
1Upload files missing on the server.
2Upload files that are missing or newer locally.
3Upload only files that already exist remotely and are newer locally.
4Upload files that are missing or have a different size.
5Upload files that are missing, have a different size, or are newer locally.

The synchronization filters apply, and GetSyncedFiles returns the relative paths uploaded.

Returns True for success, False for failure.

More Information and Examples
top
SyncRemoteTreeAsync (1)
function CkFtp2_SyncRemoteTreeAsync(objHandle: HCkFtp2;
    localRoot: PWideChar;
    mode: Integer): HCkTask; stdcall;

Creates an asynchronous task to call the SyncRemoteTree method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
SyncRemoteTree2
function CkFtp2_SyncRemoteTree2(objHandle: HCkFtp2;
    localDirPath: PWideChar;
    mode: Integer;
    bDescend: wordbool;
    bPreviewOnly: wordbool): wordbool; stdcall;

Provides the upload synchronization behavior of SyncRemoteTree with traversal and preview controls. localDirPath is the local root, mode is the synchronization mode, bDescend controls whether subdirectories are traversed, and bPreviewOnly selects preview-only mode.

When bPreviewOnly is True, files are not uploaded and the candidate file paths are placed in SyncPreview. Required remote directories may still be created during the preview.

Returns True for success, False for failure.

top
SyncRemoteTree2Async (1)
function CkFtp2_SyncRemoteTree2Async(objHandle: HCkFtp2;
    localDirPath: PWideChar;
    mode: Integer;
    bDescend: wordbool;
    bPreviewOnly: wordbool): HCkTask; stdcall;

Creates an asynchronous task to call the SyncRemoteTree2 method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
Syst
function CkFtp2_Syst(objHandle: HCkFtp2;
    outStr: HCkString): wordbool; stdcall;
function CkFtp2__syst(objHandle: HCkFtp2): PWideChar; stdcall;

Sends SYST and returns the server's operating-system type reply. Chilkat can use this information when interpreting legacy directory listings.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
SystAsync (1)
function CkFtp2_SystAsync(objHandle: HCkFtp2): HCkTask; stdcall;

Creates an asynchronous task to call the Syst method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top

Events

AbortCheck
function MyAbortCheck(): Integer; cdecl;
Introduced in version 9.5.0.82

Enables a method call to be aborted by triggering the AbortCheck event at intervals defined by the HeartbeatMs property. If HeartbeatMs is set to its default value of 0, no events will occur. For instance, set HeartbeatMs to 200 to trigger 5 AbortCheck events per second. Return True to abort; return False to continue (not abort)

More Information and Examples
top
PercentDone
function MyPercentDone(pctDone: Integer): Integer; cdecl;
Introduced in version 9.5.0.82

This provides the percentage completion for any method involving network communications or time-consuming processing, assuming the progress can be measured as a percentage. This event is triggered only when it's possible and logical to express the operation's progress as a percentage. The pctDone argument will range from 1 to 100. For methods that finish quickly, the number of PercentDone callbacks may vary, but the final callback will have pctDone equal to 100. For longer operations, callbacks will not exceed one per percentage point (e.g., 1, 2, 3, ..., 98, 99, 100).

The PercentDone callback also acts as an AbortCheck event. For fast methods where PercentDone fires, an AbortCheck event may not trigger since the PercentDone callback already provides an opportunity to abort. For longer operations, where time between PercentDone callbacks is extended, AbortCheck callbacks enable more responsive operation termination.

Return True to abort; return False to continue (not abort)

More Information and Examples
top
ProgressInfo
procedure MyProgressInfo(name: PWideChar; value: PWideChar) cdecl;
Introduced in version 9.5.0.82

This event callback provides tag name/value pairs that detail what occurs during a method call. To discover existing tag names, create code to handle the event, emit the pairs, and review them. Most tag names are self-explanatory.

Note: Some Chilkat methods don't fire any ProgressInfo events.

More Information and Examples
top
TaskCompleted
procedure MyTaskCompleted(task: HCkTask) cdecl;
Introduced in version 9.5.0.82

Called from the background thread when an asynchronous task completes.

top

Deprecated

AsyncBytesReceived
function CkFtp2_getAsyncBytesReceived(objHandle: HCkFtp2): LongWord; stdcall;
This property is deprecated. It will be removed in a future version.

Deprecated. Returns the number of bytes received during the current FTP download as a 32-bit unsigned integer. The value is updated while the transfer is running. Use CurBytesReceived instead.

top
AsyncBytesReceived64
function CkFtp2_getAsyncBytesReceived64(objHandle: HCkFtp2): Int64; stdcall;
This property is deprecated. It will be removed in a future version.

Deprecated. Returns the number of bytes received during the current FTP download as a 64-bit integer. The value is updated while the transfer is running. Use CurBytesReceived64 instead.

top
AsyncBytesReceivedStr
procedure CkFtp2_getAsyncBytesReceivedStr(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
function CkFtp2__asyncBytesReceivedStr(objHandle: HCkFtp2): PWideChar; stdcall;
This property is deprecated. It will be removed in a future version.

Deprecated. Returns the number of bytes received during the current FTP download as a decimal string. The value is updated while the transfer is running. Use CurBytesReceivedStr instead.

See the notes about PWideChar memory ownership and validity.

top
AsyncBytesSent
function CkFtp2_getAsyncBytesSent(objHandle: HCkFtp2): LongWord; stdcall;
This property is deprecated. It will be removed in a future version.

Deprecated. Returns the number of bytes sent during the current FTP upload as a 32-bit unsigned integer. The value is updated while the transfer is running. Use CurBytesSent instead.

top
AsyncBytesSent64
function CkFtp2_getAsyncBytesSent64(objHandle: HCkFtp2): Int64; stdcall;
This property is deprecated. It will be removed in a future version.

Deprecated. Returns the number of bytes sent during the current FTP upload as a 64-bit integer. The value is updated while the transfer is running. Use CurBytesSent64 instead.

top
AsyncBytesSentStr
procedure CkFtp2_getAsyncBytesSentStr(objHandle: HCkFtp2; outPropVal: HCkString); stdcall;
function CkFtp2__asyncBytesSentStr(objHandle: HCkFtp2): PWideChar; stdcall;
This property is deprecated. It will be removed in a future version.

Deprecated. Returns the number of bytes sent during the current FTP upload as a decimal string. The value is updated while the transfer is running. Use CurBytesSentStr instead.

See the notes about PWideChar memory ownership and validity.

top
AppendFileFromBinaryData Deprecated
function CkFtp2_AppendFileFromBinaryData(objHandle: HCkFtp2;
    remoteFilename: PWideChar;
    content: HCkByteData): wordbool; stdcall;

Appends the bytes in content to the remote file named by remoteFilename. No character encoding or line-ending conversion is performed.

Returns True for success, False for failure.

top
AppendFileFromBinaryDataAsync Deprecated (1)
function CkFtp2_AppendFileFromBinaryDataAsync(objHandle: HCkFtp2;
    remoteFilename: PWideChar;
    content: HCkByteData): HCkTask; stdcall;

Creates an asynchronous task to call the AppendFileFromBinaryData method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
DetermineProxyMethod
function CkFtp2_DetermineProxyMethod(objHandle: HCkFtp2): Integer; stdcall;
This method is deprecated.

Deprecated. Tries the supported traditional FTP-proxy login sequences and returns the first successful ProxyMethod value. Returns 0 when none succeeds and -1 when the test cannot be completed.

More Information and Examples
top
DetermineProxyMethodAsync (1)
function CkFtp2_DetermineProxyMethodAsync(objHandle: HCkFtp2): HCkTask; stdcall;
This method is deprecated.

Creates an asynchronous task to call the DetermineProxyMethod method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
DetermineSettings
function CkFtp2_DetermineSettings(objHandle: HCkFtp2;
    outXmlReport: HCkString): wordbool; stdcall;
function CkFtp2__determineSettings(objHandle: HCkFtp2): PWideChar; stdcall;
This method is deprecated.

Deprecated. Tests combinations of Ssl, AuthTls, AuthSsl, Port, Passive, and PassiveUseHostAddr by attempting a directory listing, then returns an XML report.

The method performs multiple network attempts and can take significant time. Prefer configuring the connection explicitly from the server's documented FTP/FTPS settings.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
DetermineSettingsAsync (1)
function CkFtp2_DetermineSettingsAsync(objHandle: HCkFtp2): HCkTask; stdcall;
This method is deprecated.

Creates an asynchronous task to call the DetermineSettings method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetCreateDt
function CkFtp2_GetCreateDt(objHandle: HCkFtp2;
    index: Integer): HCkDateTime; stdcall;
This method is deprecated and replaced by GetCreateTimeStr

Deprecated. Returns a new DateTime containing the creation time for cached directory-listing entry index. Use GetCreateTimeStr when a string result is preferred. index is a zero-based index from 0 through one less than GetDirCount.

Returns nil on failure

top
GetCreateDtAsync (1) (2)
function CkFtp2_GetCreateDtAsync(objHandle: HCkFtp2;
    index: Integer): HCkTask; stdcall;
This method is deprecated and replaced by GetCreateTimeStr

Creates an asynchronous task to call the GetCreateDt method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetCreateDtByName
function CkFtp2_GetCreateDtByName(objHandle: HCkFtp2;
    filename: PWideChar): HCkDateTime; stdcall;
This method is deprecated and replaced by GetCreateTimeByNameStr

Deprecated. Returns a new DateTime containing the creation time for the file or directory named by filename in the current remote directory. Use GetCreateTimeByNameStr when a string result is preferred.

filename must be a name, not a path. Set the current remote directory first, and ensure ListPattern matches the name so the item is present in the cached listing.

Creation times: Many UNIX-like filesystems and FTP listing formats do not provide a file creation time. In that case the server or parser may report the modification time instead.

Returns nil on failure

top
GetCreateDtByNameAsync (1) (2)
function CkFtp2_GetCreateDtByNameAsync(objHandle: HCkFtp2;
    filename: PWideChar): HCkTask; stdcall;
This method is deprecated and replaced by GetCreateTimeByNameStr

Creates an asynchronous task to call the GetCreateDtByName method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetLastModDt
function CkFtp2_GetLastModDt(objHandle: HCkFtp2;
    index: Integer): HCkDateTime; stdcall;
This method is deprecated and replaced by GetLastModifiedTimeStr

Deprecated. Returns a new DateTime containing the last-modified time for cached directory-listing entry index. Use GetLastModifiedTimeStr when a string result is preferred.

Returns nil on failure

top
GetLastModDtAsync (1) (2)
function CkFtp2_GetLastModDtAsync(objHandle: HCkFtp2;
    index: Integer): HCkTask; stdcall;
This method is deprecated and replaced by GetLastModifiedTimeStr

Creates an asynchronous task to call the GetLastModDt method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetLastModDtByName
function CkFtp2_GetLastModDtByName(objHandle: HCkFtp2;
    filename: PWideChar): HCkDateTime; stdcall;
This method is deprecated and replaced by GetLastModifiedTimeByNameStr

Deprecated. Returns a new DateTime containing the last-modified time for the item named by filename in the current remote directory. Use GetLastModifiedTimeByNameStr when a string result is preferred.

filename must be a name, not a path. Set the current remote directory first, and ensure ListPattern matches the name.

Returns nil on failure

top
GetLastModDtByNameAsync (1) (2)
function CkFtp2_GetLastModDtByNameAsync(objHandle: HCkFtp2;
    filename: PWideChar): HCkTask; stdcall;
This method is deprecated and replaced by GetLastModifiedTimeByNameStr

Creates an asynchronous task to call the GetLastModDtByName method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetRemoteFileBinaryData Deprecated
function CkFtp2_GetRemoteFileBinaryData(objHandle: HCkFtp2;
    remoteFilename: PWideChar;
    outData: HCkByteData): wordbool; stdcall;

Downloads the remote file at remoteFilename and returns its bytes. No character decoding or line-ending conversion is performed.

Returns True for success, False for failure.

More Information and Examples
top
GetRemoteFileBinaryDataAsync Deprecated (1)
function CkFtp2_GetRemoteFileBinaryDataAsync(objHandle: HCkFtp2;
    remoteFilename: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the GetRemoteFileBinaryData method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
GetSslServerCert
function CkFtp2_GetSslServerCert(objHandle: HCkFtp2): HCkCert; stdcall;
This method is deprecated and replaced by GetServerCert

Deprecated. Returns a new Cert containing the certificate presented by the FTP server during the current or most recent TLS connection. Use GetServerCert instead.

Returns nil on failure

top
PutFileFromBinaryData Deprecated
function CkFtp2_PutFileFromBinaryData(objHandle: HCkFtp2;
    remoteFilename: PWideChar;
    content: HCkByteData): wordbool; stdcall;

Creates or replaces the remote file at remoteFilename with the bytes in content. No character encoding or line-ending conversion is performed.

Returns True for success, False for failure.

More Information and Examples
top
PutFileFromBinaryDataAsync Deprecated (1)
function CkFtp2_PutFileFromBinaryDataAsync(objHandle: HCkFtp2;
    remoteFilename: PWideChar;
    content: HCkByteData): HCkTask; stdcall;

Creates an asynchronous task to call the PutFileFromBinaryData method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top