Table of Contents

Class SshScpExtensions

Namespace
SshSharp.Scp
Assembly
SshSharp.dll

File transfers with SCP (the server's scp program in sink or source mode). Uploads and downloads of single files, streams and whole directories, with progress and cancellation. Names the server sends while downloading are checked: a file or directory name must be a single path component, so nothing is ever written outside the target.

public static class SshScpExtensions
Inheritance
SshScpExtensions
Inherited Members

Methods

DownloadAsync(SshClient, string, Stream, SshScpOptions?, CancellationToken)

Downloads the remote file remotePath into destination.

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

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

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).

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.

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.

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

Uploads localPath to remotePath (a file, or an existing directory to put it in).