Skip to content

Download services for Microsoft Blazor. Use these services to download files.

License

Notifications You must be signed in to change notification settings

Append-IT/Blazor.Downloads

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Downloads

Service to download files in Microsoft Blazor.

Package Version NuGet Downloads License

Installation

Install-Package Append.Blazor.Downloads

Demo

There is a sample application in /docs folder which is also hosted as documentation.

Usage

Add IDownloadsService via DI in Program.cs

Scoped by default.

builder.Services.AddDownloadServices();

Inject into component/pages

@using Append.Blazor.Downloads
@inject IDownloadService DownloadService

or

Inject on a BlazorComponent class:

[Inject] public IDownloadService DownloadService { get; set; } = default!;

Download a file

// Your file stream
var randomBinaryData = new byte[50 * 1024];
var fileStream = new MemoryStream(randomBinaryData);

await DownloadService.DownloadFileAsync("myFile.txt", fileStream);

Contributions and feedback

Please feel free to use the component, open issues, fix bugs or provide feedback.

Contributors

This project is created and maintained by:

About

Download services for Microsoft Blazor. Use these services to download files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published