Sftp.PutFile Method
Namespace: Rebex.Net
Assembly: Rebex.Sftp.dll (version 7.0.9119)
PutFile(Stream, String)
Uploads the content of the data stream to the file on the server, overriding it if it already exists.
Declaration
public long PutFile(Stream sourceStream, string remotePath)
Parameters
Type | Name | Description |
---|---|---|
Stream | sourceStream | The source data stream. |
String | remotePath | The path of the remote file. This cannot be a directory. |
Returns
Type | Description |
---|---|
Int64 | Number of bytes transferred. |
Implements
PutFile(String, String)
Uploads the content of the local file to the file on the server, overriding it if it already exists.
Declaration
public long PutFile(string localPath, string remotePath)
Parameters
Type | Name | Description |
---|---|---|
String | localPath | The path of the local file. |
String | remotePath | The path of the remote file. This cannot be a directory. |
Returns
Type | Description |
---|---|
Int64 | Number of bytes transferred. |
Implements
PutFile(Stream, String, Int64, Int64)
Uploads the content of the data stream to the specified offset of the file on the SFTP server.
Declaration
public long PutFile(Stream sourceStream, string remotePath, long remoteOffset, long length)
Parameters
Type | Name | Description |
---|---|---|
Stream | sourceStream | The source data stream. |
String | remotePath | The path of the remote file. This cannot be a directory. |
Int64 | remoteOffset | The starting offset of the remote file. |
Int64 | length | Number of bytes to transfer or -1 to transfer all data until an end is reached. |
Returns
Type | Description |
---|---|
Int64 | Number of bytes transferred. |
Implements
Remarks
If the remote file does not exist, it is created.
PutFile(String, String, Int64, Int64, Int64)
Uploads the specified part of the local file to the specified offset of the file on the SFTP server.
Declaration
public long PutFile(string localPath, string remotePath, long localOffset, long remoteOffset, long length)
Parameters
Type | Name | Description |
---|---|---|
String | localPath | The path of the local file. |
String | remotePath | The path of the remote file. This cannot be a directory. |
Int64 | localOffset | The starting offset in the local file. |
Int64 | remoteOffset | The starting offset of the remote file. |
Int64 | length | Number of bytes to transfer or -1 to transfer all data until an end is reached. |
Returns
Type | Description |
---|---|
Int64 | Number of bytes transferred. |
Implements
Remarks
If the remote file does not exist, it is created.