Table of Contents

Method UploadFileAsync

Namespace
SshSharp.Sftp
Assembly
SshSharp.dll

UploadFileAsync(string, string, SftpTransferOptions?, CancellationToken)

Uploads the local file localPath to remotePath. With Preserve, the remote file gets the local one's modification and access times, and its permissions where this system has Unix modes. With Segments, a large file is written in parallel ranges over several sessions.

public Task<long> UploadFileAsync(string localPath, string remotePath, SftpTransferOptions? options = null, CancellationToken cancellationToken = default)

Parameters

localPath string
remotePath string
options SftpTransferOptions
cancellationToken CancellationToken

Returns

Task<long>

The number of bytes uploaded.