Note: Are you missing properties for setting Username and Password? Look to parent TSynaClient object! (Username and Password have default values for "anonymous" FTP login)
Are you missing properties for specify server address and port? Look to parent TSynaClient too!
Parse remote side information of data channel from value string (returned by EPSV command). This function you need only in special cases!
function FTPCommand(const Value: string): integer; virtual;
Send Value as FTP command to FTP server. Returned result code is result of this function. This command is good for sending site specific command, or non-standard commands.
function Login: Boolean; virtual;
Connect and logon to FTP server. If you specify any FireWall, connect to firewall and throw them connect to FTP server. Login sequence depending on FWMode.
function Logout: Boolean; virtual;
Logoff and disconnect from FTP server.
procedure Abort; virtual;
Break current transmission of data. (You can call this method from Sock.OnStatus event, or from another thread.)
procedure TelnetAbort; virtual;
Break current transmission of data. It is same as Abort, but it send abort telnet commands prior ABOR FTP command. Some servers need it. (You can call this method from Sock.OnStatus event, or from another thread.)
function List(Directory: string; NameList: Boolean): Boolean; virtual;
Download directory listing of Directory on FTP server. If Directory is empty string, download listing of current working directory. If NameList is True, download only names of files in directory. (internally use NLST command instead LIST command) If NameList is False, returned list is also parsed to FtpList property.
function RetrieveFile(const FileName: string; Restore: Boolean): Boolean; virtual;
Read data from FileName on FTP server. If Restore is True and server supports resume dowloads, download is resumed. (received is only rest of file)
function StoreFile(const FileName: string; Restore: Boolean): Boolean; virtual;
Send data to FileName on FTP server. If Restore is True and server supports resume upload, upload is resumed. (send only rest of file) In this case if remote file is same length as local file, nothing will be done. If remote file is larger then local, resume is disabled and file is transfered from begin!
function StoreUniqueFile: Boolean; virtual;
Send data to FTP server and assing unique name for this file.
function AppendFile(const FileName: string): Boolean; virtual;
Append data to FileName on FTP server.
function RenameFile(const OldName, NewName: string): Boolean; virtual;
Rename on FTP server file with OldName to NewName.
function DeleteFile(const FileName: string): Boolean; virtual;
Delete file FileName on FTP server.
function FileSize(const FileName: string): int64; virtual;
Return size of Filename file on FTP server. If command failed (i.e. not implemented), return -1.
function NoOp: Boolean; virtual;
Send NOOP command to FTP server for preserve of disconnect by inactivity timeout.
function ChangeWorkingDir(const Directory: string): Boolean; virtual;
Change currect working directory to Directory on FTP server.
function ChangeToParentDir: Boolean; virtual;
walk to upper directory on FTP server.
function ChangeToRootDir: Boolean; virtual;
walk to root directory on FTP server. (May not work with all servers properly!)
function DeleteDir(const Directory: string): Boolean; virtual;
Delete Directory on FTP server.
function CreateDir(const Directory: string): Boolean; virtual;
Create Directory on FTP server.
function GetCurrentDir: String; virtual;
Return current working directory on FTP server.
function DataRead(const DestStream: TStream): Boolean; virtual;
Establish data channel to FTP server and retrieve data. This function you need only in special cases, i.e. when you need to implement some special unsupported FTP command!
function DataWrite(const SourceStream: TStream): Boolean; virtual;
Establish data channel to FTP server and send data. This function you need only in special cases, i.e. when you need to implement some special unsupported FTP command.
Properties
property ResultCode: Integer read FResultCode;
After FTP command contains result number of this operation.
Type of Firewall. Used only if you set some firewall address. Supported predefined firewall login sequences are described by comments in source file where you can see pseudocode decribing each sequence.
Mode of data handling by data connection. If False, all data operations are made to or from DataStream TMemoryStream. If True, data operations is made directly to file in your disk. (filename is specified by DirectFileName property.) Dafault is False!
Force to listen for dataconnection on standard port (20). Default is False, dataconnections will be made to any non-standard port reported by PORT FTP command. This setting is not used, if you use passive mode.
When is True, then is disabled EPSV and EPRT support. However without this commands you cannot use IPv6! (Disabling of this commands is needed only when you are behind some crap firewall/NAT.