Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 1.41 KB

README.md

File metadata and controls

39 lines (26 loc) · 1.41 KB

Blazor.DownloadFileFast

NuGet

Fast download from files to the browser from Blazor without any javascript library reference or dependency.

BlazorDownloadFileFast is the solution to saving files on the client-side, and is perfect for web apps that generates files on the client.

When using this project in a NET 5.0 or 6.0 Blazor WebAssembly project, there is an additional speed increase. Read the blog post mentioned from Gérald Barré in the credits.

Usage

Register

builder.Services.AddBlazorDownloadFile();

Inject in code-behind

[Inject]
public IBlazorDownloadFileService BlazorDownloadFileService { get; set; }

Use in your code

byte[] bytes = ...; 
await BlazorDownloadFileService.DownloadFileAsync("example.txt", bytes);

Credits

Demo

https://stefh.github.io/Blazor.DownloadFileFast/