Method FTPClient2():putFile() Foundation

Uploads a local file.

Syntax
:putFile( <cLocalFile>, [<cRemoteFile>], [<bProgressBlock>] ) --> lSuccess
Parameters
<cLocalFile>
Path to the local file to be uploaded.
<cRemoteFile>
The optional remote path specifies the absolute or relative location on the server where the file should be saved. If this parameter is omitted, the remote path defaults to the filename provided in the parameter <cSourceFile>.
<bProgressBlock>
An optional code block which is evaluated while the file is uploaded to the FTP server. The code block can be used for monitoring or visualizing the progress of the file transfer. The code block is evaluated with the following parameters:
{|nSent, nTotal| ... } 
The first parameter <nSent> is the number of bytes already uploaded to the server. The second parameter <nTotal> indicates the number of bytes to upload and is equal to the file size of <cSourceFile>.
Return

.T. (true) if the operation succeeded, .F. (false) otherwise.

Description

Uploads a local file to the FTP server. The method opens and closes the source file automatically.

Unlike :put(), this method reads the file in chunks, optimizing memory consumption for large files.

In case of an error condition when opening the source file, use :getLastError() and :getLastMessage() methods to obtain detailed error information.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.