Method UploadDirectoryAsync
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). With
MaxConcurrentFiles above 1, several files are uploaded at once.
Filter chooses what is uploaded, and SkipUnchanged leaves remote
files that match the local ones in size and modification time.
public Task<SftpTransferSummary> UploadDirectoryAsync(string localDirectory, string remoteDirectory, SftpTransferOptions? options = null, CancellationToken cancellationToken = default)
Parameters
localDirectorystringremoteDirectorystringoptionsSftpTransferOptionscancellationTokenCancellationToken
Returns
Exceptions
- DirectoryNotFoundException
localDirectorydoes not exist.