Table of Contents

Method UploadDirectoryAsync

Namespace
SshSharp.Scp
Assembly
SshSharp.dll

UploadDirectoryAsync(SshClient, string, string, SshScpOptions?, CancellationToken)

Uploads the directory localDirectory and everything in it (scp -r). As with scp, it becomes remotePath when that does not exist, or a directory inside it when it does.

public static Task UploadDirectoryAsync(this SshClient client, string localDirectory, string remotePath, SshScpOptions? options = null, CancellationToken cancellationToken = default)

Parameters

client SshClient
localDirectory string
remotePath string
options SshScpOptions
cancellationToken CancellationToken

Returns

Task

Exceptions

SshException

The remote scp refused or failed (TransferFailed).