Skip to content
This repository has been archived by the owner on Jan 7, 2021. It is now read-only.

Latest commit

 

History

History
35 lines (26 loc) · 1.44 KB

README.md

File metadata and controls

35 lines (26 loc) · 1.44 KB

FirebaseStorage.net

AppVeyor Build status

Easily upload files and other content to Firebase Storage. More info in a blog post

For Authenticating with Firebase checkout the Firebase Authentication library and related blog post

Installation

// Install release version
Install-Package FirebaseStorage.net -pre

Supported frameworks

.NET Standard 1.1 - see https://github.com/dotnet/standard/blob/master/docs/versions.md for compatibility matrix

Usage

// Get any Stream - it can be FileStream, MemoryStream or any other type of Stream
var stream = File.Open(@"C:\Users\you\file.png", FileMode.Open);

// Constructr FirebaseStorage, path to where you want to upload the file and Put it there
var task = new FirebaseStorage("your-bucket.appspot.com")
    .Child("data")
    .Child("random")
    .Child("file.png")
    .PutAsync(stream);

// Track progress of the upload
task.Progress.ProgressChanged += (s, e) => Console.WriteLine($"Progress: {e.Percentage} %");

// await the task to wait until upload completes and get the download url
var downloadUrl = await task;