Method UploadAsync
UploadAsync(SshClient, Stream, string, long?, SshScpOptions?, CancellationToken)
Uploads length bytes of source as the file remotePath. The length is
needed up front (SCP sends it before the data); a seekable stream's remaining length is used when it is null.
public static Task UploadAsync(this SshClient client, Stream source, string remotePath, long? length = null, SshScpOptions? options = null, CancellationToken cancellationToken = default)
Parameters
clientSshClientsourceStreamremotePathstringlengthlong?optionsSshScpOptionscancellationTokenCancellationToken
Returns
Exceptions
- SshException
The remote scp refused or failed (TransferFailed).