-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Blazor Server File Streaming freezes UI #33752
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
Comments
@ylr-research thanks for contacting us. I believe the issue you are facing is likely that you are sending a gigantic blob of data from the server to the browser as a string (based on your Client - Shared - FileExtensions.cs code) We would suggest you break that into multiple JS interop calls and collect the results at the end into a single payload. We are working on a feature that will make this much easier to do. See here for details. |
Thanks @javiercn for the quick response. |
@javiercn do you happen to know of any POC on how to do it? I'm assuming the API should yield return chunks and once completed I should do the single payload, but have never done that. |
@ylr-research You can check our InputFile component and copy the implementation but do it the other way around, other than that we don't have anything built, that's what we are adding for 6.0 |
fair enough. Thanks! |
@javiercn I know this issue was closed, but I noticed while using my current approach, the file won't go to the Downloads window until finished. Thus, I get no progress. |
This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes. See our Issue Management Policies for more information. |
Background
I have a Blazor Server hosting model with an API to download files. It could be fetched from a Azure blob storage or file share. In the Client I have a page with a button that calls the API to download a file. As of now, everything works, but the UX is bad since the UI is frozen until the current download is completed. If the file to download is 1GB, UI will be frozen for a long time. Is there a way to improve this?
Server - File API
Client - index.js
Client - Shared - FileExtensions.cs
Client - Pages - Files
The text was updated successfully, but these errors were encountered: