You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cancalletion token and download callback in the SftpClient DownloadFileAsync / BeginDownloadFile? #1765
Both methods call InternalDownloadFile, which accepts both a download callback and a cancellation token.
However:
DownloadFileAsync does not support a download callback.
BeginDownloadFile does not support a cancellation token.
Is there a specific reason for this design?
I'm struggling to implement a sequential download of multiple files with a global timeout (for example, a timeout that applies to the entire download process across all files) along with progress reporting. With the current API, this seems unnecessarily challenging.
Please note that I'm not a very advanced user of async in c#. If the above does not make sense, I would appreciate advice on how to do it better.
changed the title [-]Cancalletion token and download callback in DownloadFileAsync / BeginDownloadFile?[/-][+]Cancalletion token and download callback in the SftpClient DownloadFileAsync / BeginDownloadFile?[/+]on Feb 5, 2026
Activity
[-]Cancalletion token and download callback in DownloadFileAsync / BeginDownloadFile?[/-][+]Cancalletion token and download callback in the SftpClient DownloadFileAsync / BeginDownloadFile?[/+]SftpClient: add DownloadFileAsync overload with downloadCallback
mus65 commentedon Mar 14, 2026
I assume this is just an oversight, opened #1771 .
The Begin* APIs really shouldn't be used anymore.
SftpClient: add IProgress to DownloadFileAsync and UploadFileAsync (#…