Upload

Declaration: TFtpConnection.Upload (SrcFile, DstFile: string; Append: boolean): integer;
The method Upload sends the file SrcFile to the FTP server and stores it there under the name DstFile. If Append is TRUE the uploaded file is appended to DstFile.

The function returns the following error codes:

 0 ... everything is OK
-1 ... not connected
-2 ... SrcFile does not exist
-4 ... cannot write file (access error)
-5 ... the FTP server does not recognize one or more particular FTP commands (try to use passive mode)
-9 ... unspecified error

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