Table of Contents

Method DownloadFileAsync

Namespace
SshSharp.Scp
Assembly
SshSharp.dll

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

Downloads the remote file remotePath to localPath (a file, or an existing directory to put it in under the remote name).

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

Parameters

client SshClient
remotePath string
localPath string
options SshScpOptions
cancellationToken CancellationToken

Returns

Task

Exceptions

SshException

The file does not exist, is a directory, or the transfer failed (TransferFailed).