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
I see that it was mentioned before that a file transfer could be aborted by throwing an exception in the progressCallback. The problem is that i couldn't manage to do that, as the exception is not passed to the UploadFileAsync method, and instead is thrown into my main thread.
The text was updated successfully, but these errors were encountered:
yes, you also have to try..catch around your UploadFileAsync obviously
example with download:
varcts=newCancellationTokenSource();// some other thread/task may trigger the cts.Cancel()try{usingvarfs=newFileStream("download.bin",FileMode.Create);awaitClient.DownloadFileAsync(document,fs,progress:(progress,total)=>cts.Token.ThrowIfCancellationRequested());}catch(OperationCanceledExceptionex){Console.WriteLine("Transfer was aborted");}
I see that it was mentioned before that a file transfer could be aborted by throwing an exception in the progressCallback. The problem is that i couldn't manage to do that, as the exception is not passed to the UploadFileAsync method, and instead is thrown into my main thread.
The text was updated successfully, but these errors were encountered: