Class TFTPSend

DescriptionHierarchyFieldsMethodsProperties

Unit

ftpsend

Declaration

type TFTPSend = class(TSynaClient)

Description

Implementation of FTP protocol.

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!

Hierarchy

TFTPSend > TSynaClient > TObject

Fields

 NameDescription
Public CustomLogon

Custom definition of login sequence. You can use this when you set FWMode to value -1.

Methods

Overview

Public constructor Create;
Public destructor Destroy; override;
Public procedure Abort; virtual;
Public function AppendFile(const FileName: string): Boolean; virtual;
Public function ChangeToRootDir: Boolean; virtual;
Public function ChangeWorkingDir(const Directory: string): Boolean; virtual;
Public function CreateDir(const Directory: string): Boolean; virtual;
Public function DataRead(const DestStream: TStream): Boolean; virtual;
Public function DataWrite(const SourceStream: TStream): Boolean; virtual;
Public function DeleteDir(const Directory: string): Boolean; virtual;
Public function DeleteFile(const FileName: string): Boolean; virtual;
Public function FileSize(const FileName: string): integer; virtual;
Public function FTPCommand(const Value: string): integer; virtual;
Public function GetCurrentDir: String; virtual;
Public function List(Directory: string; NameList: Boolean): Boolean; virtual;
Public function Login: Boolean; virtual;
Public function Logout: Boolean; virtual;
Public function NoOp: Boolean; virtual;
Public procedure ParseRemote(Value: string); virtual;
Public procedure ParseRemoteEPSV(Value: string); virtual;
Public function ReadResult: Integer; virtual;
Public function RenameFile(const OldName, NewName: string): Boolean; virtual;
Public function RetrieveFile(const FileName: string; Restore: Boolean): Boolean; virtual;
Public function StoreFile(const FileName: string; Restore: Boolean): Boolean; virtual;
Public function StoreUniqueFile: Boolean; virtual;

Description

Public procedure Abort; virtual;

Break current transmission of data. (You can call this method from Sock.OnStatus event, or from another thread.)

Public function AppendFile(const FileName: string): Boolean; virtual;

Append data to FileName on FTP server.

Public function ChangeToRootDir: Boolean; virtual;

walk to upper directory on FTP server.

Public function ChangeWorkingDir(const Directory: string): Boolean; virtual;

Change currect working directory to Directory on FTP server.

Public constructor Create;

 

Public function CreateDir(const Directory: string): Boolean; virtual;

Create Directory on FTP server.

Public 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!

Public 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.

Public function DeleteDir(const Directory: string): Boolean; virtual;

Delete Directory on FTP server.

Public function DeleteFile(const FileName: string): Boolean; virtual;

Delete file FileName on FTP server.

Public destructor Destroy; override;

 

Public function FileSize(const FileName: string): integer; virtual;

Return size of Filename file on FTP server. If command failed (i.e. not implemented), return -1.

Public 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.

Public function GetCurrentDir: String; virtual;

Return current working directory on FTP server.

Public 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.

Public 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.

Public function Logout: Boolean; virtual;

Logoff and disconnect from FTP server.

Public function NoOp: Boolean; virtual;

Send NOOP command to FTP server for preserve of disconnect by inactivity timeout.

Public procedure ParseRemote(Value: string); virtual;

Parse remote side information of data channel from value string (returned by PASV command). This function you need only in special cases!

Public procedure ParseRemoteEPSV(Value: string); virtual;

Parse remote side information of data channel from value string (returned by EPSV command). This function you need only in special cases!

Public function ReadResult: Integer; virtual;

Waits and read FTP server response. You need this only in special cases!

Public function RenameFile(const OldName, NewName: string): Boolean; virtual;

Rename on FTP server file with OldName to NewName.

Public 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)

Public 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!

Public function StoreUniqueFile: Boolean; virtual;

Send data to FTP server and assing unique name for this file.

Properties

Overview

Published property Account: string;
Published property AutoTLS: Boolean;
Published property BinaryMode: Boolean;
Published property CanResume: Boolean;
Published property DataIP: string;
Published property DataPort: string;
Published property DataStream: TMemoryStream;
Published property DirectFile: Boolean;
Published property DirectFileName: string;
Published property DSock: TTCPBlockSocket;
Published property ForceDefaultPort: Boolean;
Published property ForceOldPort: Boolean;
Published property FtpList: TFTPList;
Published property FullResult: TStringList;
Published property FullSSL: Boolean;
Published property FWHost: string;
Published property FWMode: integer;
Published property FWPassword: string;
Published property FWPort: string;
Published property FWUsername: string;
Published property IsDataTLS: Boolean;
Published property IsTLS: Boolean;
Published property OnStatus: TFTPStatus;
Published property PassiveMode: Boolean;
Published property ResultCode: Integer;
Published property ResultString: string;
Published property Sock: TTCPBlockSocket;
Published property TLSonData: Boolean;

Description

Published property Account: string;

Account information used in some cases inside login sequence.

Published property AutoTLS: Boolean;

if is true, then if server support upgrade to SSL/TLS mode, then use them.

Published property BinaryMode: Boolean;

if True (default), then data transfers is in binary mode. If this is set to False, then ASCII mode is used.

Published property CanResume: Boolean;

Indicate after Login if remote server support resume downloads and uploads.

Published property DataIP: string;

After data connection is established, contains remote side IP of this connection.

Published property DataPort: string;

After data connection is established, contains remote side port of this connection.

Published property DataStream: TMemoryStream;

If you not use DirectFile mode, all data transfers is made to or from this stream.

Published property DirectFile: Boolean;

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!

Published property DirectFileName: string;

Filename for direct disk data operations.

Published property DSock: TTCPBlockSocket;

Socket object used for TCP/IP operation on data channel. Good for seting OnStatus hook, etc.

Published property ForceDefaultPort: Boolean;

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.

Published property ForceOldPort: Boolean;

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.

Published property FtpList: TFTPList;

After LIST command is here parsed list of files in given directory.

Published property FullResult: TStringList;

After any FTP command it contains all lines of FTP server reply.

Published property FullSSL: Boolean;

if server listen on SSL/TLS port, then you set this to true.

Published property FWHost: string;

Address of firewall. If empty string (default), firewall not used.

Published property FWMode: integer;

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.

Published property FWPassword: string;

password for login to firewall. (if needed)

Published property FWPort: string;

port of firewall. standard value is same port as ftp server used. (21)

Published property FWUsername: string;

Username for login to firewall. (if needed)

Published property IsDataTLS: Boolean;

Signalise, if data transfers is in SSL/TLS mode.

Published property IsTLS: Boolean;

Signalise, if control channel is in SSL/TLS mode.

Published property OnStatus: TFTPStatus;

You may set this hook for monitoring FTP commands and replies.

Published property PassiveMode: Boolean;

If true (default value), all transfers is made by passive method. It is safer method for various firewalls.

Published property ResultCode: Integer;

After FTP command contains result number of this operation.

Published property ResultString: string;

After FTP command contains main line of result.

Published property Sock: TTCPBlockSocket;

Socket object used for TCP/IP operation on control channel. Good for seting OnStatus hook, etc.

Published property TLSonData: Boolean;

If True (default), then try to use SSL/TLS on data transfers too. If False, then SSL/TLS is used only for control connection.


Generated by PasDoc 0.8.8.2 on 2005-01-19 20:01:17