-
-
Notifications
You must be signed in to change notification settings - Fork 4
SSH.SFTPSession.Put
Andrew Lambert edited this page Nov 26, 2022
·
6 revisions
SSH.SFTPSession.Put
Function Put(FileName As String, Overwrite As Boolean = False, Mode As Integer = &o744) As SSH.SSHStream
Function Put(FileName As String, Upload As Readable, Overwrite As Boolean = False, Mode As Integer = &o744) As Boolean
Name | Type | Comment |
---|---|---|
FileName |
String | The name to save the upload under on the server. |
Overwrite |
Boolean | Optional. If True then an existing file will be overwritten if it exists. |
Mode |
Integer | Optional. The Unix-style permissions to apply to the file. |
Name | Type | Comment |
---|---|---|
FileName |
String | The name to save the upload under on the server. |
Upload |
Readable | The stream from which uploaded data will be read. |
Overwrite |
Boolean | Optional. If True then an existing file will be overwritten if it exists. |
Mode |
Integer | Optional. The Unix-style permissions to apply to the file. |
On success, returns an object that implements the SSHStream interface, from which the downloaded data can be read. On error returns Nil
; check STFPSession.LastError for error details.
Returns True
if the file was uploaded successfully. Check STFPSession.LastError for error details if this method returns False
.
Uploads the file to the server using SFTP.
If the file already exists on the server and Overwrite=False
then the operation will fail and SFTPSession.LastStatusCode will be LIBSSH2_FX_FILE_ALREADY_EXISTS
(11
). To append data to an existing file use the SFTPSession.Append method.
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2018-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.