Upload Files to Azure Blob Storage
|Product||FileSelect for Blazor,
Upload for Blazor
How to upload files to Microsoft Azure Blob Storage by using Telerik Blazor components?
Can I upload files directly to Azure Blob Storage?
Both the FileSelect and Upload components can help with uploading files to Azure Blob Storage. There are some differences between how the two components work, which will determine the exact usage.
TelerikFileSelect provides the selected files to the .NET runtime as a
System.IO.Stream. Use the
OnSelect event to obtain the file and send it to the Azure blob service.
TelerikUpload needs an HTTP endpoint, which will receive the uploaded file via a POST request.
The Azure Blob Service does not expose such HTTP endpoint. Do the following:
Savecontroller action method in the Blazor app.
- Set the action method URL as a
SaveUrlin the Upload.
- Send the uploaded file to the blob service after you obtain it in the
In this way, the file will go to your Blazor app server first, then to the Azure storage.
No matter which component you use, we recommend sending the file to the Blazor application server first. This will spare the need to expose sensitive authentication information about the blob storage to the client.