Method CopyFileAsync
CopyFileAsync(string, string, bool, CancellationToken)
Copies sourcePath to destinationPath on the server (copy-data): the data never travels
through this machine. The destination is created, or with overwrite replaced.
public Task CopyFileAsync(string sourcePath, string destinationPath, bool overwrite = false, CancellationToken cancellationToken = default)
Parameters
sourcePathstringdestinationPathstringoverwriteboolcancellationTokenCancellationToken
Returns
- Task
Nothing; the copy is complete when this returns.
Exceptions
- NotSupportedException
The server lacks
copy-data; download and upload instead.- SftpException
The destination is the source itself (Failure), or another error.