Ftp2 Node.js Reference Documentation
Ftp2
Current Version: 11.5.0
Chilkat.Ftp2
Connect using plain FTP, explicit TLS, or implicit TLS, with control over
ports, timeouts, passive mode, and IPv4/IPv6 behavior.
Transfer files, text, binary data, streams, and in-memory content, with
support for resume, append, and progress monitoring.
List directories, create and remove folders, rename files, delete files,
inspect sizes and timestamps, and manage remote paths.
Upload or download directory trees, mirror folders, and synchronize local
and remote content.
Use TLS options, client certificates, secure password handling, and
secret-backed credential references where appropriate.
Use
For an extended overview, see
Ftp2 Class Overview.
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
Upload and download files
Remote file management
Recursive and sync operations
Security and credentials
Diagnostics and TLS details
LastErrorText, session logs, directory listings, and
TLS negotiation details to troubleshoot server behavior.
Object Creation
var obj = new chilkat.Ftp2();
Properties
AbortCurrent
· boolean
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.
Account
· string
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.
ActivePortRangeEnd
· integer
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.
ActivePortRangeStart
· integer
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.
AllocateSize
· integer
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.
AllowMlsd
· boolean
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.
AuthSsl
· boolean
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.
AuthTls
· boolean
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.
AutoFeat
· boolean
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.
AutoFix
· boolean
Controls automatic correction of common FTPS settings based on Port. The default is true. Before connecting:
| Port | Automatic adjustment |
|---|---|
990 | Sets Ssl to true and sets AuthTls and AuthSsl to false. |
21 | Sets Ssl to false so explicit FTPS may be used. |
AutoGetSizeForProgress
· boolean
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.
AutoOptsUtf8
· boolean
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.
AutoSetUseEpsv
· boolean
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.
AutoSyst
· boolean
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.
AutoXcrc
· boolean
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.
BandwidthThrottleDown
· integer
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.
BandwidthThrottleUp
· integer
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.
ClientIpAddress
· string
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.
CommandCharset
· string
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.
ConnectFailReason
· integer, read-only
Contains a numeric reason code after Connect or ConnectOnly fails. Use this value for broad classification and inspect LastErrorText for detailed diagnostics.
| Code | Meaning |
|---|---|
0 | Success. |
1 | The hostname is empty. |
2 | DNS lookup failed. |
3 | DNS lookup timed out. |
4 | Cancelled by the application. |
5 | Internal failure. |
6 | TCP connection timed out. |
7 | TCP connection was rejected or otherwise failed. |
100 | Internal TLS failure. |
101 | Failed to send the TLS ClientHello. |
102 | An unexpected TLS handshake message was received. |
103 | Failed to read the ServerHello. |
104 | The server did not provide a certificate. |
105 | Unexpected TLS protocol version. |
106 | Server certificate verification failed. |
107 | The negotiated TLS version is not allowed. |
109 | Failed while reading TLS handshake messages. |
110 | Failed to send the client-certificate handshake message. |
111 | Failed to send the client key exchange. |
112 | The client certificate private key is not accessible. |
113 | Failed to send client certificate verification. |
114 | Failed to send ChangeCipherSpec. |
115 | Failed to send the Finished handshake message. |
116 | The server Finished message is invalid. |
200 | Connected, but the FTP greeting was not received. |
201 | The AUTH TLS or AUTH SSL upgrade failed. |
300 | An asynchronous operation is already in progress. |
301 | FTP authentication failed. |
ConnectTimeout
· integer
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.
ConnectVerified
· boolean, read-only
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.
CrlfMode
· integer
Controls line-ending conversion when downloading in ASCII transfer mode. The default is 0.
| Value | Downloaded text |
|---|---|
0 | Leaves line endings as received. |
1 | Converts line endings to CRLF. |
2 | Converts line endings to LF. |
3 | Converts line endings to CR. |
CurBytesReceived
· integer, read-only
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.
topCurBytesReceived64
· 64-bit integer, read-only
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.
topCurBytesReceivedStr
· string, read-only
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.
topCurBytesSent
· integer, read-only
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.
topCurBytesSent64
· 64-bit integer, read-only
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.
topCurBytesSentStr
· string, read-only
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.
topDataProtection
· string
Specifies the protection level for FTP data connections. The value is compared case-insensitively.
| Value | Behavior |
|---|---|
control | Default. Data connections use the same protection state as the control connection. |
clear | Data connections use unencrypted TCP, even when the control connection uses TLS. |
private | Data connections are protected with TLS. |
DebugLogFilePath
· string
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.
DirListingCharset
· string
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.
DownloadTransferRate
· integer, read-only
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.
topEnableSecrets
· boolean
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.
ForcePortIpAddress
· string
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-.
controluses the local address of the established control connection.bind-192.0.2.10both advertises the address and binds the local data-listener socket to it.- A plain address changes only the address sent in the FTP command.
Greeting
· string, read-only
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.
HasModeZ
· boolean, read-only
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.
Hostname
· string
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.
HttpProxyAuthMethod
· string
Specifies the authentication method used with an HTTP proxy. Supported values are Basic and NTLM. Leave empty when the proxy does not require authentication.
HttpProxyDomain
· string
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.
topHttpProxyHostname
· string
Specifies the hostname or numeric IP address of an HTTP proxy used to establish the FTP control connection. Leave empty to connect directly.
HttpProxyPassword
· string
Specifies the password used to authenticate to the HTTP proxy. It is used together with HttpProxyUsername and HttpProxyAuthMethod.
HttpProxyPort
· integer
Specifies the TCP port of the HTTP proxy. Common values include 8080 and 3128, but the correct value is determined by the proxy configuration.
HttpProxyUsername
· string
Specifies the username used to authenticate to the HTTP proxy. Leave empty when the proxy allows unauthenticated connections.
IdleTimeoutMs
· integer
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.
topIsConnected
· boolean, read-only
Deprecated. Indicates whether the object appears to be connected and authenticated. Reading this property may send NOOP to test the session. Use CheckConnection instead.
KeepSessionLog
· boolean
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.
LargeFileMeasures
· boolean
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.
topLastErrorHtml
· string, read-only
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.
topLastErrorText
· string, read-only
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.
LastErrorXml
· string, read-only
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.
topLastMethodSuccess
· boolean
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.
LastReply
· string, read-only
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.
ListOption
· string
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.
ListPattern
· string
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.
LoginVerified
· boolean, read-only
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.
PartialTransfer
· boolean, read-only
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.
topPassive
· boolean
Selects the FTP data-connection mode. The default is true for passive mode. Set to false for active mode.
| Mode | Connection direction |
|---|---|
| Passive | The server listens and the client connects to the server for each data transfer. |
| Active | The client listens and the server connects back to the client. |
PassiveUseHostAddr
· boolean
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.
topPassword
· string
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.
Port
· integer
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.
PreferIpv6
· boolean
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.
topPreferNlst
· boolean
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.
KeepAllowMlsd enabled whenever possible because MLSD is the standardized machine-readable listing command.ProgressMonSize
· integer
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.
ProgressMonSize64
· 64-bit integer
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.
ProxyHostname
· string
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.
ProxyMethod
· integer
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.
| Value | Sequence 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 |
ProxyPassword
· string
Specifies the password used to authenticate to a traditional FTP proxy or firewall. Its placement in the login exchange depends on ProxyMethod.
ProxyPort
· integer
Specifies the TCP port on which the traditional FTP proxy or firewall accepts connections.
topProxyUsername
· string
Specifies the username used to authenticate to a traditional FTP proxy or firewall. Its placement in the login exchange depends on ProxyMethod.
ReadTimeout
· integer
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.
topRequireSslCertVerify
· boolean
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.
RestartNext
· boolean
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.
SessionLog
· string, read-only
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.
SocksHostname
· string
Specifies the hostname or IP address of the SOCKS proxy. It is used only when SocksVersion is 4 or 5.
SocksPassword
· string
Specifies the password for SOCKS5 username/password authentication. It is ignored for SOCKS4, which has no password-authentication field.
topSocksPort
· integer
Specifies the SOCKS proxy port. The default is 1080. It is used only when SocksVersion is 4 or 5.
SocksUsername
· string
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.
SocksVersion
· integer
Selects SOCKS proxy usage.
| Value | Behavior |
|---|---|
0 | Default. Connect directly without a SOCKS proxy. |
4 | Connect through a SOCKS4 proxy. |
5 | Connect through a SOCKS5 proxy. |
SoRcvBuf
· integer
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.
SoSndBuf
· integer
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.
Ssl
· boolean
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.
SslAllowedCiphers
· string
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.
SslProtocol
· string
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 value | Behavior |
|---|---|
default | Uses the library's current secure protocol policy. |
TLS 1.3 | Requires exactly TLS 1.3. |
TLS 1.2 | Requires exactly TLS 1.2. |
TLS 1.2 or higher | Allows TLS 1.2 and newer supported versions. |
TLS 1.0 or higher | Allows 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.
SslServerCertVerified
· boolean, read-only
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.
SyncCreateAllLocalDirs
· boolean
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.
SyncMustMatch
· string
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.
SyncMustMatchDir
· string
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.
SyncMustNotMatch
· string
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.
SyncMustNotMatchDir
· string
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.
SyncPreview
· string, read-only
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.
TlsCipherSuite
· string, read-only
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.
TlsPinSet
· string
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.
TlsVersion
· string, read-only
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.
UncommonOptions
· string
Provides a comma-separated list of compatibility options for uncommon platform or server requirements. The default is empty and should normally remain empty.
| Keyword | Effect |
|---|---|
OpenNonExclusive | On Windows, opens a local download file without exclusive sharing so another process may access it while data is being written. |
ProtectFromVpn | On Android, requests that FTP sockets bypass an active VPN. |
EnableTls13 | Compatibility switch that explicitly enables offering TLS 1.3 in builds where it is not already enabled by policy. |
DisableTls13 | Prevents TLS 1.3 negotiation for compatibility with a problematic peer. |
NoPreserveFileTime | Leaves downloaded files with the current local time instead of attempting to preserve the remote modification time. |
UploadTransferRate
· integer, read-only
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.
topUseEpsv
· boolean
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.
Username
· string
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.
VerboseLogging
· boolean
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.
Version
· string, read-only
Methods
AppendFile
· Returns Boolean (true for success, false for failure).
· localFilePath String
· remoteFilePath String
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.
topAppendFileAsync (1)
· Returns a Task
· localFilePath String
· remoteFilePath String
Creates an asynchronous task to call the AppendFile method with the arguments provided.
Returns null on failure
AppendFileBd
· Returns Boolean (true for success, false for failure).
· remoteFilename String
· bd BinData
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.
topAppendFileBdAsync (1)
· Returns a Task
· remoteFilename String
· bd BinData
Creates an asynchronous task to call the AppendFileBd method with the arguments provided.
Returns null on failure
AppendFileFromBinaryData
· Returns Boolean (true for success, false for failure).
· remoteFilename String
· content Buffer
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.
topAppendFileFromBinaryDataAsync (1)
· Returns a Task
· remoteFilename String
· content Buffer
Creates an asynchronous task to call the AppendFileFromBinaryData method with the arguments provided.
Returns null on failure
AppendFileFromTextData
· Returns Boolean (true for success, false for failure).
· remoteFilename String
· textData String
· charset String
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.
topAppendFileFromTextDataAsync (1)
· Returns a Task
· remoteFilename String
· textData String
· charset String
Creates an asynchronous task to call the AppendFileFromTextData method with the arguments provided.
Returns null on failure
AppendFileSb
· Returns Boolean (true for success, false for failure).
· remoteFilename String
· sb StringBuilder
· charset String
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.
topAppendFileSbAsync (1)
· Returns a Task
· remoteFilename String
· sb StringBuilder
· charset String
Creates an asynchronous task to call the AppendFileSb method with the arguments provided.
Returns null on failure
ChangeRemoteDir
· Returns Boolean (true for success, false for failure).
· remoteDirPath String
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.
GetCurrentRemoteDir to inspect it.Returns true for success, false for failure.
topChangeRemoteDirAsync (1)
· Returns a Task
· remoteDirPath String
Creates an asynchronous task to call the ChangeRemoteDir method with the arguments provided.
Returns null on failure
CheckConnection
· Returns Boolean (true for success, false for failure).
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.
topCheckConnectionAsync (1)
· Returns a Task
Creates an asynchronous task to call the CheckConnection method with the arguments provided.
Returns null on failure
ClearControlChannel
· Returns Boolean (true for success, false for failure).
Requests that an explicit-FTPS control connection return to clear text after authentication. Data connections may remain protected according to DataProtection.
Returns true for success, false for failure.
topClearControlChannelAsync (1)
· Returns a Task
Creates an asynchronous task to call the ClearControlChannel method with the arguments provided.
Returns null on failure
ClearDirCache
· Does not return anything (returns Undefined).
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.
ClearSessionLog
· Does not return anything (returns Undefined).
Clears the in-memory FTP protocol log collected while KeepSessionLog is enabled.
Connect
· Returns Boolean (true for success, false for failure).
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.
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.
topConnectAsync (1)
· Returns a Task
Creates an asynchronous task to call the Connect method with the arguments provided.
Returns null on failure
ConnectOnly
· Returns Boolean (true for success, false for failure).
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.
ConnectOnlyAsync (1)
· Returns a Task
Creates an asynchronous task to call the ConnectOnly method with the arguments provided.
Returns null on failure
ConvertToTls
· Returns Boolean (true for success, false for failure).
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.
topConvertToTlsAsync (1)
· Returns a Task
Creates an asynchronous task to call the ConvertToTls method with the arguments provided.
Returns null on failure
CreatePlan
· Returns a String.
· localDir String
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.
Returns null on failure
CreatePlanAsync (1)
· Returns a Task
· localDir String
Creates an asynchronous task to call the CreatePlan method with the arguments provided.
Returns null on failure
CreateRemoteDir
· Returns Boolean (true for success, false for failure).
· remoteDirPath String
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.
topCreateRemoteDirAsync (1)
· Returns a Task
· remoteDirPath String
Creates an asynchronous task to call the CreateRemoteDir method with the arguments provided.
Returns null on failure
DeleteMatching
· Returns a Number.
· remotePattern String
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.
DeleteMatchingAsync (1)
· Returns a Task
· remotePattern String
Creates an asynchronous task to call the DeleteMatching method with the arguments provided.
Returns null on failure
DeleteRemoteFile
· Returns Boolean (true for success, false for failure).
· remoteFilePath String
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.
topDeleteRemoteFileAsync (1)
· Returns a Task
· remoteFilePath String
Creates an asynchronous task to call the DeleteRemoteFile method with the arguments provided.
Returns null on failure
DeleteTree
· Returns Boolean (true for success, false for failure).
Recursively deletes the files and subdirectories beneath the current remote directory and then removes directories as they become empty.
Returns true for success, false for failure.
DeleteTreeAsync (1)
· Returns a Task
Creates an asynchronous task to call the DeleteTree method with the arguments provided.
Returns null on failure
DirTreeXml
· Returns a String.
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 null on failure
DirTreeXmlAsync (1)
· Returns a Task
Creates an asynchronous task to call the DirTreeXml method with the arguments provided.
Returns null on failure
Disconnect
· Returns Boolean (true for success, false for failure).
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.
topDisconnectAsync (1)
· Returns a Task
Creates an asynchronous task to call the Disconnect method with the arguments provided.
Returns null on failure
DownloadTree
· Returns Boolean (true for success, false for failure).
· localRoot String
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.
DownloadTreeAsync (1)
· Returns a Task
· localRoot String
Creates an asynchronous task to call the DownloadTree method with the arguments provided.
Returns null on failure
Feat
· Returns a String.
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 null on failure
FeatAsync (1)
· Returns a Task
Creates an asynchronous task to call the Feat method with the arguments provided.
Returns null on failure
GetCreateTimeByNameStr
· Returns a String.
· filename String
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.
Returns null on failure
GetCreateTimeByNameStrAsync (1)
· Returns a Task
· filename String
Creates an asynchronous task to call the GetCreateTimeByNameStr method with the arguments provided.
Returns null on failure
GetCreateTimeStr
· Returns a String.
· index Number
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 null on failure
GetCreateTimeStrAsync (1)
· Returns a Task
· index Number
Creates an asynchronous task to call the GetCreateTimeStr method with the arguments provided.
Returns null on failure
GetCurrentRemoteDir
· Returns a String.
Returns the current working directory reported by the FTP server, normally by using the PWD command.
Returns null on failure
GetCurrentRemoteDirAsync (1)
· Returns a Task
Creates an asynchronous task to call the GetCurrentRemoteDir method with the arguments provided.
Returns null on failure
GetDirCount
· Returns a Number.
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.
GetDirCountAsync (1)
· Returns a Task
Creates an asynchronous task to call the GetDirCount method with the arguments provided.
Returns null on failure
GetFile
· Returns Boolean (true for success, false for failure).
· remoteFilePath String
· localFilePath String
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.
GetFileAsync (1)
· Returns a Task
· remoteFilePath String
· localFilePath String
Creates an asynchronous task to call the GetFile method with the arguments provided.
Returns null on failure
GetFileBd
· Returns Boolean (true for success, false for failure).
· remoteFilePath String
· binData BinData
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.
GetFileBdAsync (1)
· Returns a Task
· remoteFilePath String
· binData BinData
Creates an asynchronous task to call the GetFileBd method with the arguments provided.
Returns null on failure
GetFilename
· Returns a String.
· index Number
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 null on failure
GetFilenameAsync (1)
· Returns a Task
· index Number
Creates an asynchronous task to call the GetFilename method with the arguments provided.
Returns null on failure
GetFileSb
· Returns Boolean (true for success, false for failure).
· remoteFilePath String
· charset String
· sb StringBuilder
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.
GetFileSbAsync (1)
· Returns a Task
· remoteFilePath String
· charset String
· sb StringBuilder
Creates an asynchronous task to call the GetFileSb method with the arguments provided.
Returns null on failure
GetFileToStream
· Returns Boolean (true for success, false for failure).
· remoteFilePath String
· toStream Stream
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.
GetFileToStreamAsync (1)
· Returns a Task
· remoteFilePath String
· toStream Stream
Creates an asynchronous task to call the GetFileToStream method with the arguments provided.
Returns null on failure
GetGroup
· Returns a String.
· index Number
Returns the group name or identifier for cached directory-listing entry index. The value is empty when the server does not provide group metadata.
AllowMlsd may expose owner/group through LIST, at the cost of less standardized and potentially less accurate listing data.Returns null on failure
GetGroupAsync (1)
· Returns a Task
· index Number
Creates an asynchronous task to call the GetGroup method with the arguments provided.
Returns null on failure
GetIsDirectory
· Returns a Boolean.
· index Number
Returns true when cached directory-listing entry index is identified as a directory. index is a zero-based index into the current cached listing.
GetIsDirectoryAsync (1)
· Returns a Task
· index Number
Creates an asynchronous task to call the GetIsDirectory method with the arguments provided.
Returns null on failure
GetIsSymbolicLink
· Returns a Boolean.
· index Number
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.
GetIsSymbolicLinkAsync (1)
· Returns a Task
· index Number
Creates an asynchronous task to call the GetIsSymbolicLink method with the arguments provided.
Returns null on failure
GetLastJsonData
· Does not return anything (returns Undefined).
· json JsonObject
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.
topGetLastModifiedTimeByNameStr
· Returns a String.
· filename String
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 null on failure
GetLastModifiedTimeByNameStrAsync (1)
· Returns a Task
· filename String
Creates an asynchronous task to call the GetLastModifiedTimeByNameStr method with the arguments provided.
Returns null on failure
GetLastModifiedTimeStr
· Returns a String.
· index Number
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 null on failure
GetLastModifiedTimeStrAsync (1)
· Returns a Task
· index Number
Creates an asynchronous task to call the GetLastModifiedTimeStr method with the arguments provided.
Returns null on failure
GetOwner
· Returns a String.
· index Number
Returns the owner name or identifier for cached directory-listing entry index. The value is empty when the server does not provide owner metadata.
AllowMlsd may expose owner/group through LIST, at the cost of less standardized and potentially less accurate listing data.Returns null on failure
GetOwnerAsync (1)
· Returns a Task
· index Number
Creates an asynchronous task to call the GetOwner method with the arguments provided.
Returns null on failure
GetPermissions
· Returns a String.
· index Number
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 type | Returned information |
|---|---|
mlsd | The RFC 3659 perm fact. Letters describe FTP operations available to the logged-in user, such as append, create, delete, enter, list, rename, or write. |
unix | A UNIX-style string such as rwxr-xr-x. |
netware | NetWare trustee-right letters such as read, write, create, erase, modify, file scan, access control, and supervisor. |
openvms | An OpenVMS protection string such as (RWED,RWED,R,R). |
batchStatusFlags | A fixed-position Connect:Enterprise batch-status string such as -CR--M----. |
Returns null on failure
GetPermissionsAsync (1)
· Returns a Task
· index Number
Creates an asynchronous task to call the GetPermissions method with the arguments provided.
Returns null on failure
GetPermType
· Returns a String.
· index Number
Returns the format identifier for the permissions string available for cached listing entry index. The value is empty when no permissions are available.
| Value | Format |
|---|---|
mlsd | The RFC 3659 perm fact. |
unix | A UNIX/POSIX-style mode string. |
netware | NetWare trustee rights. |
openvms | An OpenVMS protection string. |
batchStatusFlags | Connect:Enterprise batch status flags. |
Use GetPermissions to obtain the corresponding value.
Returns null on failure
GetPermTypeAsync (1)
· Returns a Task
· index Number
Creates an asynchronous task to call the GetPermType method with the arguments provided.
Returns null on failure
GetRemoteFileBinaryData
· Returns a Buffer.
Downloads the remote file at remoteFilename and returns its bytes. No character decoding or line-ending conversion is performed.
Returns null on failure
GetRemoteFileBinaryDataAsync (1)
· Returns a Task
· remoteFilename String
Creates an asynchronous task to call the GetRemoteFileBinaryData method with the arguments provided.
Returns null on failure
GetRemoteFileTextC
· Returns a String.
· remoteFilename String
· charset String
Downloads the remote file at remoteFilename, decodes its bytes using the character encoding named by charset, and returns the resulting text.
Returns null on failure
GetRemoteFileTextCAsync (1)
· Returns a Task
· remoteFilename String
· charset String
Creates an asynchronous task to call the GetRemoteFileTextC method with the arguments provided.
Returns null on failure
GetRemoteFileTextData
· Returns a String.
· remoteFilename String
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 null on failure
GetRemoteFileTextDataAsync (1)
· Returns a Task
· remoteFilename String
Creates an asynchronous task to call the GetRemoteFileTextData method with the arguments provided.
Returns null on failure
GetServerCert
· Returns Boolean (true for success, false for failure).
· cert Cert
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.
topGetSize
· Returns a Number.
· index Number
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.
GetSizeAsync (1)
· Returns a Task
· index Number
Creates an asynchronous task to call the GetSize method with the arguments provided.
Returns null on failure
GetSize64
· Returns a Number.
· index Number
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.
GetSize64Async (1)
· Returns a Task
· index Number
Creates an asynchronous task to call the GetSize64 method with the arguments provided.
Returns null on failure
GetSizeByName
· Returns a Number.
· filename String
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.
GetSizeByNameAsync (1)
· Returns a Task
· filename String
Creates an asynchronous task to call the GetSizeByName method with the arguments provided.
Returns null on failure
GetSizeByName64
· Returns a Number.
· filename String
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.
GetSizeByName64Async (1)
· Returns a Task
· filename String
Creates an asynchronous task to call the GetSizeByName64 method with the arguments provided.
Returns null on failure
GetSizeStr
· Returns a String.
· index Number
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 null on failure
GetSizeStrAsync (1)
· Returns a Task
· index Number
Creates an asynchronous task to call the GetSizeStr method with the arguments provided.
Returns null on failure
GetSizeStrByName
· Returns a String.
· filename String
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 null on failure
GetSizeStrByNameAsync (1)
· Returns a Task
· filename String
Creates an asynchronous task to call the GetSizeStrByName method with the arguments provided.
Returns null on failure
GetSyncedFiles
· Does not return anything (returns Undefined).
· strTable StringTable
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.
GetTextDirListing
· Returns a String.
· pattern String
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 null on failure
GetTextDirListingAsync (1)
· Returns a Task
· pattern String
Creates an asynchronous task to call the GetTextDirListing method with the arguments provided.
Returns null on failure
GetXmlDirListing
· Returns a String.
· pattern String
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.
Returns null on failure
GetXmlDirListingAsync (1)
· Returns a Task
· pattern String
Creates an asynchronous task to call the GetXmlDirListing method with the arguments provided.
Returns null on failure
LargeFileUpload
· Returns Boolean (true for success, false for failure).
· localPath String
· remotePath String
· chunkSize Number
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.
LargeFileMeasures. Use chunked upload when infrastructure still drops the idle control session.Returns true for success, false for failure.
LargeFileUploadAsync (1)
· Returns a Task
· localPath String
· remotePath String
· chunkSize Number
Creates an asynchronous task to call the LargeFileUpload method with the arguments provided.
Returns null on failure
LoadTaskCaller
· Returns Boolean (true for success, false for failure).
· task Task
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.
topLoginAfterConnectOnly
· Returns Boolean (true for success, false for failure).
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.
LoginAfterConnectOnlyAsync (1)
· Returns a Task
Creates an asynchronous task to call the LoginAfterConnectOnly method with the arguments provided.
Returns null on failure
MGetFiles
· Returns a Number.
· remotePattern String
· localDir String
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.
MGetFilesAsync (1)
· Returns a Task
· remotePattern String
· localDir String
Creates an asynchronous task to call the MGetFiles method with the arguments provided.
Returns null on failure
MPutFiles
· Returns a Number.
· pattern String
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.
MPutFilesAsync (1)
· Returns a Task
· pattern String
Creates an asynchronous task to call the MPutFiles method with the arguments provided.
Returns null on failure
NlstXml
· Returns a String.
· remoteDirPattern String
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 null on failure
NlstXmlAsync (1)
· Returns a Task
· remoteDirPattern String
Creates an asynchronous task to call the NlstXml method with the arguments provided.
Returns null on failure
Noop
· Returns Boolean (true for success, false for failure).
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.
topNoopAsync (1)
· Returns a Task
Creates an asynchronous task to call the Noop method with the arguments provided.
Returns null on failure
PutFile
· Returns Boolean (true for success, false for failure).
· localFilePath String
· remoteFilePath String
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.
PutFileAsync (1)
· Returns a Task
· localFilePath String
· remoteFilePath String
Creates an asynchronous task to call the PutFile method with the arguments provided.
Returns null on failure
PutFileBd
· Returns Boolean (true for success, false for failure).
· binData BinData
· remoteFilePath String
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.
PutFileBdAsync (1)
· Returns a Task
· binData BinData
· remoteFilePath String
Creates an asynchronous task to call the PutFileBd method with the arguments provided.
Returns null on failure
PutFileFromBinaryData
· Returns Boolean (true for success, false for failure).
· remoteFilename String
· content Buffer
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.
PutFileFromBinaryDataAsync (1)
· Returns a Task
· remoteFilename String
· content Buffer
Creates an asynchronous task to call the PutFileFromBinaryData method with the arguments provided.
Returns null on failure
PutFileFromTextData
· Returns Boolean (true for success, false for failure).
· remoteFilename String
· textData String
· charset String
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.
PutFileFromTextDataAsync (1)
· Returns a Task
· remoteFilename String
· textData String
· charset String
Creates an asynchronous task to call the PutFileFromTextData method with the arguments provided.
Returns null on failure
PutFileSb
· Returns Boolean (true for success, false for failure).
· sb StringBuilder
· charset String
· includeBom Boolean
· remoteFilePath String
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.
PutFileSbAsync (1)
· Returns a Task
· sb StringBuilder
· charset String
· includeBom Boolean
· remoteFilePath String
Creates an asynchronous task to call the PutFileSb method with the arguments provided.
Returns null on failure
PutPlan
· Returns Boolean (true for success, false for failure).
· plan String
· alreadyDoneFilename String
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.
Returns true for success, false for failure.
PutPlanAsync (1)
· Returns a Task
· plan String
· alreadyDoneFilename String
Creates an asynchronous task to call the PutPlan method with the arguments provided.
Returns null on failure
PutTree
· Returns Boolean (true for success, false for failure).
· localDir String
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.
topPutTreeAsync (1)
· Returns a Task
· localDir String
Creates an asynchronous task to call the PutTree method with the arguments provided.
Returns null on failure
Quote
· Returns Boolean (true for success, false for failure).
· cmd String
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.
QuoteAsync (1)
· Returns a Task
· cmd String
Creates an asynchronous task to call the Quote method with the arguments provided.
Returns null on failure
RemoveRemoteDir
· Returns Boolean (true for success, false for failure).
· remoteDirPath String
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.
topRemoveRemoteDirAsync (1)
· Returns a Task
· remoteDirPath String
Creates an asynchronous task to call the RemoveRemoteDir method with the arguments provided.
Returns null on failure
RenameRemoteFile
· Returns Boolean (true for success, false for failure).
· existingRemoteFilePath String
· newRemoteFilePath String
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.
RenameRemoteFileAsync (1)
· Returns a Task
· existingRemoteFilePath String
· newRemoteFilePath String
Creates an asynchronous task to call the RenameRemoteFile method with the arguments provided.
Returns null on failure
SendCommand
· Returns a String.
· cmd String
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 null on failure
SendCommandAsync (1)
· Returns a Task
· cmd String
Creates an asynchronous task to call the SendCommand method with the arguments provided.
Returns null on failure
SetModeZ
· Returns Boolean (true for success, false for failure).
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.
Returns true for success, false for failure.
topSetModeZAsync (1)
· Returns a Task
Creates an asynchronous task to call the SetModeZ method with the arguments provided.
Returns null on failure
SetOldestDateStr
· Does not return anything (returns Undefined).
· oldestDateTimeStr String
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.
SetOption
· Returns Boolean (true for success, false for failure).
· option String
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.
topSetRemoteFileDateTimeStr
· Returns Boolean (true for success, false for failure).
· dateTimeStr String
· remoteFilename String
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.
SetRemoteFileDateTimeStrAsync (1)
· Returns a Task
· dateTimeStr String
· remoteFilename String
Creates an asynchronous task to call the SetRemoteFileDateTimeStr method with the arguments provided.
Returns null on failure
SetRemoteFileDt
· Returns Boolean (true for success, false for failure).
· dt CkDateTime
· remoteFilename String
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.
SetRemoteFileDtAsync (1)
· Returns a Task
· dt CkDateTime
· remoteFilename String
Creates an asynchronous task to call the SetRemoteFileDt method with the arguments provided.
Returns null on failure
SetSecurePassword
· Returns Boolean (true for success, false for failure).
· password SecureString
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.
topSetSslCertRequirement
· Does not return anything (returns Undefined).
· reqName String
· reqValue String
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.
SetSslClientCert
· Returns Boolean (true for success, false for failure).
· cert Cert
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.
topSetSslClientCertPem
· Returns Boolean (true for success, false for failure).
· pemDataOrFilename String
· pemPassword String
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.
topSetSslClientCertPfx
· Returns Boolean (true for success, false for failure).
· pfxFilename String
· pfxPassword String
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.
topSetTypeAscii
· Returns Boolean (true for success, false for failure).
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.
SetTypeBinary for executables, archives, images, encrypted data, and any file whose bytes must remain unchanged.Returns true for success, false for failure.
topSetTypeAsciiAsync (1)
· Returns a Task
Creates an asynchronous task to call the SetTypeAscii method with the arguments provided.
Returns null on failure
SetTypeBinary
· Returns Boolean (true for success, false for failure).
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.
topSetTypeBinaryAsync (1)
· Returns a Task
Creates an asynchronous task to call the SetTypeBinary method with the arguments provided.
Returns null on failure
Site
· Returns Boolean (true for success, false for failure).
· siteCommand String
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.
topSiteAsync (1)
· Returns a Task
· siteCommand String
Creates an asynchronous task to call the Site method with the arguments provided.
Returns null on failure
SleepMs
· Does not return anything (returns Undefined).
· millisec Number
Blocks the calling thread for millisec milliseconds. This is a utility method and performs no FTP network operation.
Stat
· Returns a String.
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 null on failure
StatAsync (1)
· Returns a Task
Creates an asynchronous task to call the Stat method with the arguments provided.
Returns null on failure
SyncDeleteRemote
· Returns Boolean (true for success, false for failure).
· localRoot String
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.
Use GetSyncedFiles after the call to obtain the relative paths deleted.
Returns true for success, false for failure.
topSyncDeleteRemoteAsync (1)
· Returns a Task
· localRoot String
Creates an asynchronous task to call the SyncDeleteRemote method with the arguments provided.
Returns null on failure
SyncLocalDir
· Returns Boolean (true for success, false for failure).
· localRoot String
· mode Number
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.
SyncLocalDirAsync (1)
· Returns a Task
· localRoot String
· mode Number
Creates an asynchronous task to call the SyncLocalDir method with the arguments provided.
Returns null on failure
SyncLocalTree
· Returns Boolean (true for success, false for failure).
· localRoot String
· mode Number
Synchronizes the remote tree rooted at the current remote directory into the local directory at localRoot. mode selects which files are downloaded or deleted.
| Mode | Action |
|---|---|
0 | Download all selected files. |
1 | Download files missing locally. |
2 | Download files that are missing locally or newer on the server. |
3 | Download only files that already exist locally and are newer on the server. |
5 | Download files that are missing locally or have a different size. |
6 | Download files that are missing, have a different size, or are newer on the server. |
99 | Do not download; delete remote files that do not exist locally. |
The synchronization filters apply, and GetSyncedFiles returns the relative paths affected by the operation.
Returns true for success, false for failure.
SyncLocalTreeAsync (1)
· Returns a Task
· localRoot String
· mode Number
Creates an asynchronous task to call the SyncLocalTree method with the arguments provided.
Returns null on failure
SyncRemoteTree
· Returns Boolean (true for success, false for failure).
· localRoot String
· mode Number
Synchronizes the local tree rooted at localRoot into the current remote directory. mode selects which files are uploaded.
| Mode | Action |
|---|---|
0 | Upload all selected files. |
1 | Upload files missing on the server. |
2 | Upload files that are missing or newer locally. |
3 | Upload only files that already exist remotely and are newer locally. |
4 | Upload files that are missing or have a different size. |
5 | Upload 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.
SyncRemoteTreeAsync (1)
· Returns a Task
· localRoot String
· mode Number
Creates an asynchronous task to call the SyncRemoteTree method with the arguments provided.
Returns null on failure
SyncRemoteTree2
· Returns Boolean (true for success, false for failure).
· localDirPath String
· mode Number
· bDescend Boolean
· bPreviewOnly Boolean
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.
SyncRemoteTree2Async (1)
· Returns a Task
· localDirPath String
· mode Number
· bDescend Boolean
· bPreviewOnly Boolean
Creates an asynchronous task to call the SyncRemoteTree2 method with the arguments provided.
Returns null on failure
Syst
· Returns a String.
Sends SYST and returns the server's operating-system type reply. Chilkat can use this information when interpreting legacy directory listings.
Returns null on failure
SystAsync (1)
· Returns a Task
Creates an asynchronous task to call the Syst method with the arguments provided.
Returns null on failure
Deprecated
AsyncBytesReceived
· integer, read-only
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.
AsyncBytesReceived64
· 64-bit integer, read-only
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.
AsyncBytesSent
· integer, read-only
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.
AsyncBytesSent64
· 64-bit integer, read-only
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.
DetermineProxyMethod
· Returns a Number.
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.
DetermineProxyMethodAsync (1)
· Returns a Task
Creates an asynchronous task to call the DetermineProxyMethod method with the arguments provided.
Returns null on failure
DetermineSettings
· Returns a String.
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 null on failure
DetermineSettingsAsync (1)
· Returns a Task
Creates an asynchronous task to call the DetermineSettings method with the arguments provided.
Returns null on failure
GetCreateDt
· Returns a CkDateTime
· index Number
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 null on failure
GetCreateDtAsync (1)
· Returns a Task
· index Number
Creates an asynchronous task to call the GetCreateDt method with the arguments provided.
Returns null on failure
GetCreateDtByName
· Returns a CkDateTime
· filename String
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.
Returns null on failure
GetCreateDtByNameAsync (1)
· Returns a Task
· filename String
Creates an asynchronous task to call the GetCreateDtByName method with the arguments provided.
Returns null on failure
GetLastModDt
· Returns a CkDateTime
· index Number
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 null on failure
GetLastModDtAsync (1)
· Returns a Task
· index Number
Creates an asynchronous task to call the GetLastModDt method with the arguments provided.
Returns null on failure
GetLastModDtByName
· Returns a CkDateTime
· filename String
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 null on failure
GetLastModDtByNameAsync (1)
· Returns a Task
· filename String
Creates an asynchronous task to call the GetLastModDtByName method with the arguments provided.
Returns null on failure
GetSslServerCert
· Returns a Cert
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 null on failure