-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overload "DownloadFile" with an option for asynchronous progress #36
Conversation
Similar to the user in #21 , I don't think I will actually be using this code in my application. Partitioned downloads are so much slower than all-at-once downloads. I wish that were not the case. |
For some and mostly cases an entire download can't be just be downloaded at once for an example blazor server. Since you have limits on the buffer size and if you exceeds blazor server max buffer size for signal r this will raise an error on the client side because the blazor server will disconnect for that connection. In your case since you are using blazor wasm it could be possible to download all at once and that is the use of the parameter To download all at once you would need to set the I haven't tested NET6 as you can see here #32 But is pretty weird that the progress is not being reported correctly for you over blazor wasm and net6.0. I need to take some time and test over net6 since the javascript code I have is backward compatible with older blazor versions and I want to keep it like that for now. |
Does the IProgress reporting correctly to you at least? Or are we not getting any value from it? |
The It is only after the partitioned download completes do I see my UI update or my console statements appear in the browser console. Converting the synchronous |
I imagine this issue with synchronous |
Makes sense and as far I remember once a time a go I run into a similar issue where an async api didn't report any synchronous operation until the task was fully completed so to overcome this we would need another task that needs to be awaited/completed to report any progress. What you suggest here works properly for you case using Please confirm to proceed with the changes over these days. |
Yes, the sample code I provided in the PR description does work. The UI will update and my console statements will appear in the browser console every time the provided Task is awaited. Take your time if you want to incorporate these changes. I am not blocked. |
Give me a few labor days these week and I will keep you updated. I am currently taking a break these days. |
Install-Package BlazorDownloadFile -Version 2.4.0.0 |
@arivera12 I believe |
@Jack-Edwards is totally true, you are right, I am rusty writing code, let me fix and create new package. |
Install-Package BlazorDownloadFile -Version 2.4.0.1 |
The existing "IProgress" options are not working well for me in Blazor WASM on .NET 6.0.
I want to update my UI every time the progress updates. Instead, none of the progress updates fire until the download completes. My progress bar shoots from 0% to 100% in an instant.
This
Func<double, Task>
option works much better. My usage: