Service to download files in Microsoft Blazor.
Install-Package Append.Blazor.Downloads
There is a sample application in /docs folder which is also hosted as documentation.
Scoped by default.
builder.Services.AddDownloadServices();
@using Append.Blazor.Downloads
@inject IDownloadService DownloadService
or
[Inject] public IDownloadService DownloadService { get; set; } = default!;
// Your file stream
var randomBinaryData = new byte[50 * 1024];
var fileStream = new MemoryStream(randomBinaryData);
await DownloadService.DownloadFileAsync("myFile.txt", fileStream);
Please feel free to use the component, open issues, fix bugs or provide feedback.
This project is created and maintained by: