Commercial File Transfer Protocol (FTP) Component.
The proxy scheme used by your FTP proxy server. Valid values are 0 to 6. The default value is 0 which indicates that no proxy server is used. Supported proxy methods are as follows:
Note: The ProxyHostname is the hostname of the firewall, if the proxy is a firewall. Also, the ProxyUsername and ProxyPassword are the firewall username/password (if the proxy is a firewall).
ProxyMethod = 1 (SITE site)
USER ProxyUsername
PASS ProxyPassword
SITE Hostname
USER Username
PASS Password
ProxyMethod = 2 (USER user@site)
USER Username@Hostname:Port
PASS Password
ProxyMethod = 3 (USER with login)
USER ProxyUsername
PASS ProxyPassword
USER Username@Hostname:Port
PASS Password
ProxyMethod = 4 (USER/PASS/ACCT)
USER Username@Hostname:Port ProxyUsername
PASS Password
ACCT ProxyPassword
ProxyMethod = 5 (OPEN site)
USER ProxyUsername
PASS ProxyPassword
OPEN Hostname
USER Username
PASS Password
ProxyMethod = 6 (firewallId@site)
USER ProxyUsername@Hostname
USER Username
PASS Password
// str is a CkString object (output)
get_ProxyPassword( str )
// newVal is a string (input)
put_ProxyPassword( newVal )
The password for authenticating with the FTP proxy server.
// Returns an integer value
get_ProxyPort( )
// newVal is an integer (input)
put_ProxyPort( newVal )
If an FTP proxy server is used, this is the port number at which the proxy server is listening for connections.
// str is a CkString object (output)
get_ProxyUsername( str )
// newVal is a string (input)
put_ProxyUsername( newVal )
The username for authenticating with the FTP proxy server.
// Returns an integer value
get_ReadTimeout( )
// newVal is an integer (input)
put_ReadTimeout( newVal )
Maximum number of seconds to wait when reading from an FTP server. The ReadTimeout is the amount of time that needs to elapse while no additional data is forthcoming. So during a long download, if the data stream halts for more than this amount, it will timeout. Otherwise, there is no limit on the length of time for the entire download.
// Returns a boolean value
get_RequireSslCertVerify( )
// newVal is a boolean (input)
put_RequireSslCertVerify( newVal )
If true, then the FTP2 client will verify the server's SSL certificate. The certificate is expired, or if the cert's signature is invalid, the connection is not allowed. The default value of this property is false.
// Returns a boolean value
get_RestartNext( )
// newVal is a boolean (input)
put_RestartNext( newVal )
Both uploads and downloads may be resumed by simply setting this property = true and re-calling the upload or download method.
Example: Restart/Resume FTP Download
Example: Restart/Resume FTP Upload
// str is a CkString object (output)
get_SessionLog( str )
Contains the session log if KeepSessionLog is turned on.
// Returns a boolean value
get_Ssl( )
// newVal is a boolean (input)
put_Ssl( newVal )
Use SSL for FTP connections. You would typically set Ssl = true when connecting to port 990 on FTP servers that support SSL mode. Note: It is more common to use AuthTls.
// Returns a boolean value
get_SslServerCertVerified( )
Read-only property that returns true if the FTP server's digital certificate was verified when connecting via SSL / TLS.
// Returns an integer value
get_UploadRate( )
The average upload rate in bytes/second. This property is updated in real-time during any FTP upload (asynchronous or synchronous).
// str is a CkString object (output)
get_Username( str )
// newVal is a string (input)
put_Username( newVal )
Username for logging into the FTP server. Defaults to "anonymous".
// str is a CkString object (output)
get_Version( str )
Version of the component, such as "1.0.0"
Methods
// localFilename is a string (input)
// remoteFilename is a string (input)
// Returns a boolean value
AppendFile( localFilename, remoteFilename )
Same as PutFile but the file on the FTP server is appended.
Returns true for success, false for failure.
// remoteFilename is a string (input)
// binaryData is a CkByteData object (input)
// Returns a boolean value
AppendFileFromBinaryData( remoteFilename, binaryData )
Same as PutFileFromBinaryData, except the file on the FTP server is appended.
Returns true for success, false for failure.
// remoteFilename is a string (input)
// textData is a string (input)
// Returns a boolean value
AppendFileFromTextData( remoteFilename, textData )
Same as PutFileFromTextData, except the file on the FTP server is appended.
Returns true for success, false for failure.
AsyncAbort( )
Causes an asynchronous Get or Put to abort.
// localFilename is a string (input)
// remoteFilename is a string (input)
// Returns a boolean value
AsyncAppendFileStart( localFilename, remoteFilename )
Initiates an asynchronous append. The file is uploaded and appended to an existing file on the FTP server. The append happens in a background thread and can be aborted by calling AsyncAbort. The AsyncFinished property can be checked periodically to determine when the background transfer is finished. The status of the transfer is available in the AsyncSuccess property. The last-error information is available in the AsyncLog property. The AsyncBytesSent property is updated in real time to reflect the current number of bytes sent while the transfer is in progress. The UploadRate is also updated with the current upload rate in bytes/second. While a transfer is in progress, a program may periodically read the UploadRate and AsyncBytesSent properties to display progress.
Returns true for success, false for failure.
// remoteFilename is a string (input)
// localFilename is a string (input)
// Returns a boolean value
AsyncGetFileStart( remoteFilename, localFilename )
Initiates an asynchronous file download. The download happens in a background thread and can be aborted by calling AsyncAbort. The AsyncFinished property can be checked periodically to determine when the background transfer is finished. The status of the transfer is available in the AsyncSuccess property. The last-error information is available in the AsyncLog property. The AsyncBytesReceived property is updated in real time to reflect the current number of bytes received while the transfer is in progress. The DownloadRate is also updated with the current download rate in bytes/second. While a transfer is in progress, a program may periodically read the DownloadRate and AsyncBytesReceived properties to display progress.
Returns true for success, false for failure.
// localFilename is a string (input)
// remoteFilename is a string (input)
// Returns a boolean value
AsyncPutFileStart( localFilename, remoteFilename )
Initiates an asynchronous file upload. The file is uploaded and creates a new file on the FTP server, or overwrites an existing file. The upload happens in a background thread and can be aborted by calling AsyncAbort. The AsyncFinished property can be checked periodically to determine when the background transfer is finished. The status of the transfer is available in the AsyncSuccess property. The last-error information is available in the AsyncLog property. The AsyncBytesSent property is updated in real time to reflect the current number of bytes sent while the transfer is in progress. The UploadRate is also updated with the current upload rate in bytes/second. While a transfer is in progress, a program may periodically read the UploadRate and AsyncBytesSent properties to display progress.
Returns true for success, false for failure.
// relativeDirPath is a string (input)
// Returns a boolean value
ChangeRemoteDir( relativeDirPath )
Changes the current remote directory.
Returns true for success, false for failure.
ClearControlChannel( )
Reverts the FTP control channel from SSL/TLS to an unencrypted channel. This may be required when using FTPS with AUTH TLS where the FTP client is behind a DSL or cable-modem router that performs NAT (network address translation). If the control channel is encrypted, the router is unable to translate the IP address sent in the PORT command for data transfers. By clearing the control channel, the data transfers will remain encrypted, but the FTP commands are passed unencrypted. Your program would typically clear the control channel after authenticating.
Returns true for success, false for failure.
ClearDirCache( )
TheNumFilesAndDirs property returns the count of files and sub-directories in the current remote FTP directory, according to the ListPattern property. For example, if ListPattern is set to “*.xml”, then NumFilesAndDirs returns the count of XML files in the remote directory.
The 1st time it is accessed, the component will (behind the scenes) fetch the directory listing from the FTP server. This information is cached in the component until (1) the current remote directory is changed, or (2) the ListPattern is changed, or (3) the this method (ClearDirCache) is called.
ClearSessionLog( )
Clears the in-memory session log.
// Returns a boolean value
Connect( )
Connects and logs in to the FTP server using the username/password provided in the component properties. Check the integer value of the ConnectFailReason if this method returns false (indicating failure).
Returns true for success, false for failure.
// Returns a boolean value
ConvertToTls( )
To be documented soon...
// localDir is a string (input)
// str is a CkString object (output)
// Returns a boolean value
CreatePlan( localDir, str )
Creates an "FTP plan" that lists the FTP operations that would be performed when PutTree is called. Additionally, the PutPlan method executes an "FTP plan" and logs each successful operation to a plan log file. If a large-scale upload is interrupted, the PutPlan can be resumed, skipping over the operations already listed in the plan log file.
Returns true for success, false for failure.
// dir is a string (input)
// Returns a boolean value
CreateRemoteDir( dir )
Creates a directory on the FTP server. If the directory already exists, a new one is not created and false is returned.
Returns true for success, false for failure.
// remotePattern is a string (input)
// Returns an integer value
DeleteMatching( remotePattern )
Deletes all the files in the current remote FTP directory matching the pattern. Returns the number of files deleted, or -1 for failure. The pattern is a string such as "*.txt", where any number of "*" wildcard characters can be used. "*" matches 0 or more of any character.
// filename is a string (input)
// Returns a boolean value
DeleteRemoteFile( filename )
Deletes a file on the FTP server.
Returns true for success, false for failure.
// Returns a boolean value
DeleteTree( )
Deletes the entire subtree and all files from the current remote FTP directory. To delete a subtree on the FTP server, your program would first navigate to the root of the subtree to be deleted by calling ChangeRemoteDir, and then call DeleteTree. There are two event callbacks: VerifyDeleteFile and VerifyDeleteDir. Both are called prior to deleting each file or directory. The arguments to the callback include the full filepath of the file or directory, and an output-only "skip" flag. If your application sets the skip flag to true, the file or directory is NOT deleted. If a directory is not deleted, all files and sub-directories will remain. Example programs can be found at http://www.example-code.com/
Returns true for success, false for failure.
Delete FTP Directory Tree
// Returns an integer value
DetermineProxyMethod( )
Automatically determines the ProxyMethod that should be used with an FTP proxy server. Tries each of the five possible ProxyMethod settings and returns the value (1-5) of the ProxyMethod that succeeded.
This method may take a minute or two to complete. Returns 0 if no proxy methods were successful. Returns -1 to indicate an error (i.e. it was unable to test all proxy methods.)
Automatically Determine FTP Proxy Method
// xmlReport is a CkString object (output)
// Returns a boolean value
DetermineSettings( xmlReport )
Discovers which combinations of FTP2 property settings result in successful data transfers.
DetermineSettings tries 13 different combinations of these properties:
Ssl
AuthTls
AuthSsl
Port
Passive
PassiveUseHostAddr
Within the FTP protocol, the process of fetching a directory listing is also considered a “data transfer”. The DetermineSettings method works by checking to see which combinations result in a successful directory listing download. The method takes no arguments and returns a string containing an XML report of the results. It is a blocking call that may take approximately a minute to run. If you are unsure about how to interpret the results, cut-and-paste it into an email and send it to support@chilkatsoft.com.Returns true for success, false for failure.
DetermineSettings Example
// strXml is a CkString object (output)
// Returns a boolean value
DirTreeXml( strXml )
Recursively downloads the structure of a complete remote directory tree. Returns an XML document with the directory structure. A zero-length string is returned to indicate failure.
Returns true for success, false for failure.
Download Directory Tree Listing as XML
// Returns a boolean value
Disconnect( )
Disconnects from the FTP server, ending the current session.
Returns true for success, false for failure.
// localRoot is a string (input)
// Returns a boolean value
DownloadTree( localRoot )
Downloads an entire tree from the FTP server and recreates the directory tree on the local filesystem.
This method downloads all the files and subdirectories in the current remote directory. An application would first navigate to the directory to be downloaded via ChangeRemoteDir and then call this method.
There are three event callbacks (for programming languages supporting events): BeginDownloadFile, EndDownloadFile, and VerifyDownloadDir. The 1st argument to each callback is the fully qualified pathname of the file or directory. The BeginDownloadFile event callbacks has a "skip" argument, which is output-only. The application can set it to true to prevent the file from being downloaded. The VerifyDownloadDir also has a "skip" argument where the application can cause an entire sub-tree to be skipped. The EndDownloadFile event includes a "numBytes" argument containing the size of the file in bytes.
Returns true for success, false for failure.
Download Directory Tree Listing as XML
// sOut is a CkString object (output)
// Returns a boolean value
Feat( sOut )
Sends a FEAT command to the FTP server and returns the response. Returns a zero-length string to indicate failure. Here is a typical response:
211-Features:
MDTM
REST STREAM
SIZE
MLST type*;size*;modify*;
MLSD
AUTH SSL
AUTH TLS
UTF8
CLNT
MFMT
211 End
Returns true for success, false for failure.
FTP FEAT Command
// index is an integer (input)
// sysTime is a SYSTEMTIME object (output)
// Returns a boolean value
GetCreateTime( index, sysTime )
Returns the create time for the Nth file or sub-directory in the current remote directory. The first file/dir is at index 0, and the last one is at index (NumFilesAndDirs-1)
// filename is a string (input)
// sysTime is a SYSTEMTIME object (output)
// Returns a boolean value
GetCreateTimeByName( filename, sysTime )
Returns the file-creation time for a remote file by filename.
// str is a CkString object (output)
// Returns a boolean value
GetCurrentRemoteDir( str )
Returns the current remote directory.
Returns true for success, false for failure.
// remoteFilename is a string (input)
// localFilename is a string (input)
// Returns a boolean value
GetFile( remoteFilename, localFilename )
Downloads a file from the FTP server to the local filesystem.
Returns true for success, false for failure.
// index is an integer (input)
// str is a CkString object (output)
// Returns a boolean value
GetFilename( index, str )
Returns the filename for the Nth file or sub-directory in the current remote directory. The first file/dir is at index 0, and the last one is at index (NumFilesAndDirs-1)
Returns true for success, false for failure.
// index is an integer (input)
// Returns a boolean value
GetIsDirectory( index )
Returns true for a sub-directory and false for a file, for the Nth entry in the current remote directory. The first file/dir is at index 0, and the last one is at index (NumFilesAndDirs-1)
// index is an integer (input)
// Returns a boolean value
GetIsSymbolicLink( index )
Returns true if the remote file is a symbolic link. (Symbolic links only exist on Unix/Linux systems, not on Windows filesystems.)
// index is an integer (input)
// sysTime is a SYSTEMTIME object (output)
// Returns a boolean value
GetLastAccessTime( index, sysTime )
Returns the last access time for the Nth file or sub-directory in the current remote directory. The first file/dir is at index 0, and the last one is at index (NumFilesAndDirs-1)
// filename is a string (input)
// sysTime is a SYSTEMTIME object (output)
// Returns a boolean value
GetLastAccessTimeByName( filename, sysTime )
Returns a remote file's last-access time.
// index is an integer (input)
// sysTime is a SYSTEMTIME object (output)
// Returns a boolean value
GetLastModifiedTime( index, sysTime )
Returns the last modified time for the Nth file or sub-directory in the current remote directory. The first file/dir is at index 0, and the last one is at index (NumFilesAndDirs-1)
// filename is a string (input)
// sysTime is a SYSTEMTIME object (output)
// Returns a boolean value
GetLastModifiedTimeByName( filename, sysTime )
Returns the last-modified date/time for a remote file.
// remoteFilename is a string (input)
// data is a CkByteData object (output)
// Returns a boolean value
GetRemoteFileBinaryData( remoteFilename, data )
Downloads the contents of a remote file into a byte array.
// remoteFilename is a string (input)
// charset is a string (input)
// str is a CkString object (output)
// Returns a boolean value
GetRemoteFileTextC( remoteFilename, charset, str )
Downloads a text file directly into a string variable. The character encoding of the text file is specified by the charset argument, which is a value such as utf-8, iso-8859-1, Shift_JIS, etc.
Returns true for success, false for failure.
// remoteFilename is a string (input)
// str is a CkString object (output)
// Returns a boolean value
GetRemoteFileTextData( remoteFilename, str )
Downloads the content of a remote text file directly into an in-memory string.
Note: If the remote text file does not use the ANSI character encoding, call GetRemoteFileTextC instead, which allows for the character encoding to be specified so that characters are properly interpreted.
Returns true for success, false for failure.
// index is an integer (input)
// Returns an integer value
GetSize( index )
Returns the size of the Nth remote file in the current directory.
// filname is a string (input)
// Returns an integer value
GetSizeByName( filname )
Returns a remote file's size in bytes.
// index is an integer (input)
// outStr is a CkString object (output)
// Returns a boolean value
GetSizeStr( index, outStr )
Returns the size of a remote filename as a string. This is helpful for file sizes that are greater then 2GB.
Returns true for success, false for failure.
// filename is a string (input)
// outStr is a CkString object (output)
// Returns a boolean value
GetSizeStrByName( filename, outStr )
To be documented soon...
// Returns a CkCert object
GetSslServerCert( )
Returns the FTP server's digital certificate (for SSL / TLS connections).
// pattern is a string (input)
// strRawListing is a CkString object (output)
// Returns a boolean value
GetTextDirListing( pattern, strRawListing )
Returns a listing of the files and directories in the current directory matching the pattern. Passing "*.*" will return all the files and directories.
Returns true for success, false for failure.
// pattern is a string (input)
// strXmlListing is a CkString object (output)
// Returns a boolean value
GetXmlDirListing( pattern, strXmlListing )
Returns (in XML format) the files and directories in the current directory matching the pattern. Passing "*.*" will return all the files and directories.
Returns true for success, false for failure.
// Returns a boolean value
IsUnlocked( )
Return true if the component is already unlocked.
// remotePattern is a string (input)
// localDir is a string (input)
// Returns an integer value
MGetFiles( remotePattern, localDir )
Copies all the files in the current remote FTP directory to a local directory. To copy all the files in a remote directory, set remotePattern to "*.*" The pattern can contain any number of "*"characters where "*" matches 0 or more of any character. The return value is the number of files transferred, and on error, a value of -1 is returned. Detailed information about the transfer can be obtained from the last-error information (LastErrorText/LastErrorHtml/LastErrorXml/SaveLastError).
// pattern is a string (input)
// Returns an integer value
MPutFiles( pattern )
Uploads all the files matching pattern on the local computer to the current remote FTP directory. The pattern parameter can include directory information, such as "C:/my_dir/*.txt" or it can simply be a pattern such as "*.*" that matches the files in the application's current directory. Subdirectories are not recursed. The return value is the number of files copied, with a value of -1 returned for errors. Detailed information about the transfer can be obtained from the XML log.[
// Returns a boolean value
Noop( )
Issues a no-op command to the FTP server.
// localFilename is a string (input)
// remoteFilename is a string (input)
// Returns a boolean value
PutFile( localFilename, remoteFilename )
Uploads a local file to the current directory on the FTP server.
Returns true for success, false for failure.
// remoteFilename is a string (input)
// binaryData is a CkByteData object (input)
// Returns a boolean value
PutFileFromBinaryData( remoteFilename, binaryData )
Creates a file on the remote server containing the data passed in a byte array.
Returns true for success, false for failure.
// remoteFilename is a string (input)
// textData is a string (input)
// Returns a boolean value
PutFileFromTextData( remoteFilename, textData )
Creates a file on the remote server containing the data passed in a string. Returns true for success, false for failure.[
// planUtf8 is a string (input)
// planLogFilename is a string (input)
// Returns a boolean value
PutPlan( planUtf8, planLogFilename )
Executes an "FTP plan" (created by the CreatePlan method) and logs each successful operation to a plan log file. If a large-scale upload is interrupted, the PutPlan can be resumed, skipping over the operations already listed in the plan log file. When resuming an interrupted PutPlan method, use the same log file. All completed operations found
in the already-existing log will automatically be skipped.
Returns true for success, false for failure.
// localDir is a string (input)
// Returns a boolean value
PutTree( localDir )
Uploads an entire directory tree from the local filesystem to the remote FTP server, recreating the directory tree on the server. The PutTree method copies a directory tree to the current remote directory on the FTP server.
Returns true for success, false for failure.
// cmd is a string (input)
// Returns a boolean value
Quote( cmd )
Sends an arbitrary (raw) command to the FTP server and returns the raw response.
// dir is a string (input)
// Returns a boolean value
RemoveRemoteDir( dir )
Removes a directory from the FTP server.
// existingFilename is a string (input)
// newFilename is a string (input)
// Returns a boolean value
RenameRemoteFile( existingFilename, newFilename )
Renames a file or directory on the FTP server. To move a file from one directory to another on a remote FTP server, call this method and include the source and destination directory filepath.
// filename is a string (input)
// Returns a boolean value
SaveLastError( filename )
Saves the last error information to an XML formatted file.
// cmd is a string (input)
// reply is a CkString object (output)
// Returns a boolean value
SendCommand( cmd, reply )
Sends an raw command to the FTP server and returns the raw response.
Returns true for success, false for failure.
// Returns a boolean value
SetModeZ( )
Chilkat FTP2 supports MODE Z, which is a transfer mode implemented by some FTP servers. It allows for files to be uploaded and downloaded using compressed streams (using the zlib deflate algorithm).
Call this method after connecting to enable Mode Z. Once enabled, all transfers (uploads, downloads, and directory listings) are compressed.
Returns true for success, false for failure.
// oldestDateTime is a SYSTEMTIME object (output)
SetOldestDate( oldestDateTime )
Used in conjunction with the DownloadTree method. Call this method prior to calling DownloadTree to set the oldest date for a file to be downloaded. When DownloadTree is called, any file older than this date will not be downloaded.
// reqName is a string (input)
// reqValue is a string (input)
SetSslCertRequirement( reqName, reqValue )
Enforces a requirement on the FTP server's certificate. The reqName can be "SubjectDN", "SubjectCN", "IssuerDN", or "IssuerCN". The reqName specifies the part of the certificate, and the reqValue is the value that it must match (exactly). If the FTP server's certificate does not match, the SSL / TLS connection is aborted.
SetSslClientCert( cert )
Allows for a client-side certificate to be used for the SSL / TLS connection.
// Returns a boolean value
SetTypeAscii( )
Set the FTP transfer mode to us-ascii.
Returns true for success, false for failure.
// Returns a boolean value
SetTypeBinary( )
Set the FTP transfer mode to binary.
Returns true for success, false for failure.
// params is a string (input)
// Returns a boolean value
Site( params )
Sends an arbitrary "site" command to the FTP server. The params argument should contain the parameters to the site command as they would appear on a command line. For example: "recfm=fb lrecl=600".
Returns true for success, false for failure.
// millisec is an integer (input)
SleepMs( millisec )
Causes the calling process to sleep for a number of milliseconds.
// sOut is a CkString object (output)
// Returns a boolean value
Stat( sOut )
Sends a STAT command to the FTP server and returns the server's reply.
Returns true for success, false for failure.
// localRoot is a string (input)
// mode is an integer (input)
// Returns a boolean value
SyncLocalTree( localRoot, mode )
Downloads files from the FTP server to a local directory tree. Synchronization modes include:
mode=0: Download all files
mode=1: Download all files that do not exist on the local filesystem.
mode=2: Download newer or non-existant files.
mode=3: Download only newer files. If a file does not already exist on the local filesystem, it is not downloaded from the server.
Example: Synchronize Local Directory Tree
// localRoot is a string (input)
// mode is an integer (input)
// Returns a boolean value
SyncRemoteTree( localRoot, mode )
Uploads a directory tree from the local filesystem to the FTP server. Synchronization modes include:
mode=0: Upload all files
mode=1: Upload all files that do not exist on the FTP server.
mode=2: Upload newer or non-existant files.
mode=3: Upload only newer files. If a file does not already exist on the FTP server, it is not uploaded.
Example: Synchronize Remote Directory Tree
// sOut is a CkString object (output)
// Returns a boolean value
Syst( sOut )
Sends a SYST command to the FTP server to find out the type of operating
system at the server. The method returns the FTP server's response string. Refer to RFC 959 for details.
Returns true for success, false for failure.
// code is a string (input)
// Returns a boolean value
UnlockComponent( code )
Unlocks the component. This must be called once prior to calling any other method.
// Returns a string
account( )
Some FTP servers require an Account name in addition to login/password. This property can be set for those servers with this requirement.
// Returns a string
asyncLog( )
The last-error information for an asynchronous (background) file transfer.
// Returns a string
ck_stat( )
To be documented soon...
// localDir is a string (input)
// Returns a string
createPlan( localDir )
Creates an "FTP plan" that lists the FTP operations that would be performed when PutTree is called. Additionally, the PutPlan method executes an "FTP plan" and logs each successful operation to a plan log file. If a large-scale upload is interrupted, the PutPlan can be resumed, skipping over the operations already listed in the plan log file.
// Returns a string
determineSettings( )
Discovers which combinations of FTP2 property settings result in successful data transfers.
DetermineSettings tries 13 different combinations of these properties:
Ssl
AuthTls
AuthSsl
Port
Passive
PassiveUseHostAddr
Within the FTP protocol, the process of fetching a directory listing is also considered a “data transfer”. The DetermineSettings method works by checking to see which combinations result in a successful directory listing download. The method takes no arguments and returns a string containing an XML report of the results. It is a blocking call that may take approximately a minute to run. If you are unsure about how to interpret the results, cut-and-paste it into an email and send it to support@chilkatsoft.com.DetermineSettings Example
// Returns a string
dirListingCharset( )
Set to "ansi" by default. If the FTP server sends directory listings with non-English filenames, this property can be set to the appropriate value if necessary.
// Returns a string
dirTreeXml( )
Recursively downloads the structure of a complete remote directory tree. Returns an XML document with the directory structure. A zero-length string is returned to indicate failure.
Returns true for success, false for failure.
Download Directory Tree Listing as XML
// Returns a string
feat( )
Sends a FEAT command to the FTP server and returns the response. Returns a zero-length string to indicate failure. Here is a typical response:
211-Features:
MDTM
REST STREAM
SIZE
MLST type*;size*;modify*;
MLSD
AUTH SSL
AUTH TLS
UTF8
CLNT
MFMT
211 End
FTP FEAT Command
// Returns a string
getCurrentRemoteDir( )
Returns the current remote directory.
// index is an integer (input)
// Returns a string
getFilename( index )
Returns the filename for the Nth file or sub-directory in the current remote directory. The first file/dir is at index 0, and the last one is at index (NumFilesAndDirs-1)
// remoteFilename is a string (input)
// charset is a string (input)
// Returns a string
getRemoteFileTextC( remoteFilename, charset )
Downloads a text file directly into a string variable. The character encoding of the text file is specified by the charset argument, which is a value such as utf-8, iso-8859-1, Shift_JIS, etc.
// remoteFilename is a string (input)
// Returns a string
getRemoteFileTextData( remoteFilename )
Downloads the content of a remote text file directly into an in-memory string.
Note: If the remote text file does not use the ANSI character encoding, call GetRemoteFileTextC instead, which allows for the character encoding to be specified so that characters are properly interpreted.
// index is an integer (input)
// Returns a string
getSizeStr( index )
Returns the size of a remote filename as a string. This is helpful for file sizes that are greater then 2GB.
// filename is a string (input)
// Returns a string
getSizeStrByName( filename )
To be documented soon...
// pattern is a string (input)
// Returns a string
getTextDirListing( pattern )
Returns a listing of the files and directories in the current directory matching the pattern. Passing "*.*" will return all the files and directories.
// pattern is a string (input)
// Returns a string
getXmlDirListing( pattern )
Returns (in XML format) the files and directories in the current directory matching the pattern. Passing "*.*" will return all the files and directories.
// Returns a string
hostname( )
The FTP server hostname.
// Returns a string
lastErrorHtml( )
Error information in HTML format for the last method called.
// Returns a string
lastErrorText( )
Error information in plain-text format for the last method called.
// Returns a string
lastErrorXml( )
Error information in XML format for the last method called.
// Returns a string
listPattern( )
A wildcard pattern, defaulting to "*" that determines the files and directories included in the following properties and methods: NumFilesAndDirs, GetCreateTime, GetFilename, GetIsDirectory, GetLastAccessTime, GetModifiedTime, GetSize.
// Returns a string
password( )
Password for logging into the FTP server.
// Returns a string
proxyHostname( )
The hostname of your FTP proxy, if a proxy server is used.
// Returns a string
proxyPassword( )
The password for authenticating with the FTP proxy server.
// Returns a string
proxyUsername( )
The username for authenticating with the FTP proxy server.
// cmd is a string (input)
// Returns a string
sendCommand( cmd )
Sends an raw command to the FTP server and returns the raw response.
// Returns a string
sessionLog( )
Contains the session log if KeepSessionLog is turned on.
// Returns a string
syst( )
Sends a SYST command to the FTP server to find out the type of operating
system at the server. The method returns the FTP server's response string. Refer to RFC 959 for details.
// Returns a string
username( )
Username for logging into the FTP server. Defaults to "anonymous".
// Returns a string
version( )
Version of the component, such as "1.0.0"