Table of Contents

Method UploadDirectoryAsync

Namespace
SshSharp.Sftp
Assembly
SshSharp.dll

UploadDirectoryAsync(string, string, SftpTransferOptions?, CancellationToken)

Uploads the local directory localDirectory and everything under it to remoteDirectory (created if needed), file by file with UploadFileAsync(string, string, SftpTransferOptions?, CancellationToken) and the same options. Symbolic links, junctions and other reparse points are skipped, and so are special files on Unix (FIFOs, sockets, devices).

public Task<SftpTransferSummary> UploadDirectoryAsync(string localDirectory, string remoteDirectory, SftpTransferOptions? options = null, CancellationToken cancellationToken = default)

Parameters

localDirectory string
remoteDirectory string
options SftpTransferOptions
cancellationToken CancellationToken

Returns

Task<SftpTransferSummary>

Exceptions

DirectoryNotFoundException

localDirectory does not exist.