Blazor Server and Azure SignalR File Download Troubleshoot

Raymond Lei 1 Reputation point
2023-04-10T02:37:35.57+00:00

We are trying out Azure SignalR with Blazor Server (dotnet 6), we followed the tutorial from this documentation: https://learn.microsoft.com/en-us/aspnet/core/blazor/file-downloads?view=aspnetcore-7.0 Building the file functionality (using the stream method) worked without using Azure SignalR. But when we set up the Azure SignalR(Premium tier), the file download is broken (the rest of the app seems to be working fine though), the browser isn't reporting any error and the WebSocket connection seems to be fine. We are not sure why this is. Thank you!

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,420 questions
Azure SignalR Service
Azure SignalR Service
An Azure service that is used for adding real-time communications to web applications.
122 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 57,891 Reputation points
    2023-04-12T16:31:11.2866667+00:00

    when you switch to Azure SignalR you no longer control buffer size. It would be a better design to allow javascript to upload the file to a webapi, then you would not have file size restrictions and better performance.

    if the files are not too large, you could use javascript interop to read the file as a data url and upload in chunks.

    0 comments No comments