Method SFTPClient():put() Foundation

Uploads file content.

Syntax
:put( <cRemoteFile>, <cData> ) --> lSuccess
Parameters
<cRemoteFile>
The relative or fully qualified path of the remote file on the server. If the file already exists on the SFTP server, it is overwritten.
<cData>
The data to be written into the remote file.
Return

.T. (true) if the upload is successful, .F. (false) otherwise.

Description

Uploads file content into a remote file. The operation creates a new file or overwrites an existing one on the SFTP server.

For large data, consider using the :putFile() method instead, which reads and transfers the data in chunks, requiring less memory during the operation.

In case of failure, detailed error information can be obtained using the :getLastError() and :getLastMessage() methods.

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.