Internet Direct (Indy) Version 9.0.2 Beta
TIdFTP.Get
Retrieves a file using the FTP protocol.

procedure Get(const ASourceFile: string; ADest: TStream; AResume: Boolean); overload;
procedure Get(const ASourceFile: string; const ADestFile: string; const ACanOverwrite: boolean; AResume: Boolean); overload;
Parameters
const ASourceFile: string
File name on the FTP server.

const ADestFile: string
File name and optional path on the local machine.

const ACanOverwrite: boolean = false
Overwrite an existing file with the same name.

AResume: Boolean = false
Partial download can be completed.

Description
Get is an overloaded procedure that allows the FTP client to retrieve a file from the FTP server with the name specified in ASourceFile using the FTP RETR command verb. The overloaded implementations of Get use either a file- or a stream-based destination for the data from the FTP server, as specified in ADestFile or ADest.

Get allows continuing a previous partial download or appending data to an existing file on the local file system when AResume is True and CanResume indicates that the FTP server implementation allows the FTP REST command verb.

In the file-based variant of the method, the destination file will be created before retrieving data when ACanOverwrite is True or the file does not already exist. When ACanOverwite is False and AResume is True, the destination file will be opened and position to the end of the file before retrieving data.

An EIdFTPFileAlreadyExists exception will be raised when the destination file in ADestFile already exists, and both ACanOverwrite and AResume contain False.

In the stream-based variant of the method, data returned from the FTP server can be accessed in the stream specified in ADest.

Use Put to transfer data from the FTP client to the FTP server.