Skip to content

Add UploadFileAsync and DownloadFileAsync methods#1634

Merged
Rob-Hague merged 24 commits intosshnet:developfrom
sdt-ndelarosa:feature/sftp-file-async
May 5, 2025
Merged

Add UploadFileAsync and DownloadFileAsync methods#1634
Rob-Hague merged 24 commits intosshnet:developfrom
sdt-ndelarosa:feature/sftp-file-async

Conversation

@sdt-ndelarosa
Copy link
Copy Markdown
Contributor

@sdt-ndelarosa sdt-ndelarosa commented Apr 24, 2025

Adds TAP methods for UploadFile and DownloadFile to ISftpClient.

Other Solutions

While there are other options to define both the UploadFileAsync and DownloadFileAsync methods, such as the extension methods approach and the previously proposed pull request, #1515 , this pull request has the following benefits over the other solutions:

  • First class async/await support for uploading and downloading
    • Users no longer have to rely on implementing their own extension methods
  • Cleaner interop with the sync versions of the UploadFile and DownloadFile methods
    • Method signatures have a closer match
  • Upload and downloads now work with relative paths instead of just absolute paths
  • Deeper async/await call chain, as compared to BeginUploadFile, which pretty much runs the sync UploadFile method, but just in a different thread

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants