Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/IvanJosipovic/BlazorFileSaver
Blazor Component wrapper for FileSaver.js
https://github.com/IvanJosipovic/BlazorFileSaver
Last synced: 3 months ago
JSON representation
Blazor Component wrapper for FileSaver.js
- Host: GitHub
- URL: https://github.com/IvanJosipovic/BlazorFileSaver
- Owner: IvanJosipovic
- License: mit
- Created: 2019-02-09T23:37:12.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T08:27:29.000Z (7 months ago)
- Last Synced: 2024-01-18T09:06:42.690Z (5 months ago)
- Language: HTML
- Homepage: https://BlazorFileSaver.netlify.com
- Size: 287 KB
- Stars: 25
- Watchers: 4
- Forks: 8
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- AdrienTorris_awesome-blazor - BlazorFileSaver - Blazor Component wrapper for FileSaver.js ([Demo](https://blazorfilesaver.netlify.com)). (Libraries & Extensions / Others)
- awesome-blazor - BlazorFileSaver - ![stars](https://img.shields.io/github/stars/IvanJosipovic/BlazorFileSaver?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/IvanJosipovic/BlazorFileSaver?style=flat-square&cacheSeconds=86400) Blazor Component wrapper for FileSaver.js ([Demo](https://blazorfilesaver.netlify.com)). (Libraries & Extensions / Others)
- blazor-awesome - BlazorFileSaver - Blazor Component wrapper for FileSaver.js ([Demo](https://blazorfilesaver.netlify.com)). (Libraries & Extensions / Others)
README
# BlazorFileSaver
[![Demo](https://img.shields.io/badge/Live-Demo-Blue?style=flat-square)](https://blazorfilesaver.netlify.com)
[![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/BlazorFileSaver.svg?style=flat-square)](https://www.nuget.org/packages/BlazorTable)
[![Nuget (with prereleases)](https://img.shields.io/nuget/dt/BlazorFileSaver.svg?style=flat-square)](https://www.nuget.org/packages/BlazorTable)
![](https://github.com/IvanJosipovic/BlazorFileSaver/workflows/CI/CD/badge.svg)Blazor Component wrapper for [FileSaver.js](https://github.com/eligrey/FileSaver.js/)
# Demo
[Sample](https://blazorfilesaver.netlify.com)# Installation
- Add Nuget [BlazorFileSaver](https://www.nuget.org/packages/BlazorTable)
- Add ```` to the index.html or _Hosts.cshtml
- Add AddBlazorFileSaver() to the ConfigureServices in Program.cs as noted below# Program.cs
```csharp
namespace BlazorFileSaver.Sample
{
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add("app");builder.Services.AddBlazorFileSaver(); // Add This!
await builder.Build().RunAsync();
}
}
}
```# Example
```csharp
@page "/sample"BlazorFileSaver.Sample
Save
@code {
[Inject]
private IBlazorFileSaver BlazorFileSaver { get; set; }
private string FileName { get; set; } = "Sample.txt";private string Data { get; set; } = "Sample Text";
private async Task Save()
{
await BlazorFileSaver.SaveAs(FileName, Data);
}
}
```# More Examples
[SaveAsBase64 Zip](https://github.com/IvanJosipovic/BlazorFileSaver/blob/master/src/BlazorFileSaver.Sample/Pages/Index.razor)