Download

Declaration: TFtpConnection.Download (SrcFile, DstFile: string): integer;
The method Download retrieves the file SrcFile from the FTP server and stores the retrieved file locally in the file DstFile.

The function returns the following error codes:

 0 ... everything is OK
-1 ... not connected
-2 ... source file not found
-3 ... cannot read file (access error)
-5 ... the FTP server does not recognize one or more particular FTP commands (try to use passive mode)
-6 ... path to DstFile does not exist
-9 ... unspecified error

Hint: Most FTP servers are Unix-based. Thus the path to the source file (SrcFile) normally uses slashes (/) instead of backslashes (\) to separate directories. Failing to use the correct separation character will result in an error (-2).