Table of Contents

Method UploadAsync

Namespace
SshSharp.Scp
Assembly
SshSharp.dll

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

client SshClient
source Stream
remotePath string
length long?
options SshScpOptions
cancellationToken CancellationToken

Returns

Task

Exceptions

SshException

The remote scp refused or failed (TransferFailed).