Table of Contents

Method DownloadAsync

Namespace
SshSharp.Sftp
Assembly
SshSharp.dll

DownloadAsync(string, Stream, SftpTransferOptions?, CancellationToken)

Downloads remotePath into destination, with several reads in flight (the window, by default 64 reads of up to MaxReadLength), which is what makes SFTP fast on links with latency.

public Task<long> DownloadAsync(string remotePath, Stream destination, SftpTransferOptions? options = null, CancellationToken cancellationToken = default)

Parameters

remotePath string
destination Stream
options SftpTransferOptions
cancellationToken CancellationToken

Returns

Task<long>

The number of bytes downloaded.