https://github.com/step-up-labs/firebase-storage-dotnet
C# library for Firebase Storage
https://github.com/step-up-labs/firebase-storage-dotnet
firebase firebase-auth firebase-database firebase-storage gcloud
Last synced: 3 months ago
JSON representation
C# library for Firebase Storage
- Host: GitHub
- URL: https://github.com/step-up-labs/firebase-storage-dotnet
- Owner: step-up-labs
- License: mit
- Created: 2017-01-01T19:00:14.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-06-18T08:25:52.000Z (almost 3 years ago)
- Last Synced: 2025-09-28T18:21:19.365Z (6 months ago)
- Topics: firebase, firebase-auth, firebase-database, firebase-storage, gcloud
- Language: C#
- Homepage:
- Size: 258 KB
- Stars: 141
- Watchers: 7
- Forks: 34
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FirebaseStorage.net
[](https://ci.appveyor.com/project/bezysoftware/firebase-storage-dotnet)
Easily upload files and other content to Firebase Storage. More info in a [blog post](https://medium.com/step-up-labs/firebase-storage-c-library-d1656cc8b3c3)
For Authenticating with Firebase checkout the [Firebase Authentication library](https://github.com/step-up-labs/firebase-authentication-dotnet) and related [blog post](https://medium.com/step-up-labs/firebase-authentication-c-library-8e5e1c30acc2)
## Installation
```csharp
// 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
```csharp
// 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);
//authentication
var auth = new FirebaseAuthProvider(new FirebaseConfig("api_key"));
var a = await auth.SignInWithEmailAndPasswordAsync("email", "password");
// Constructr FirebaseStorage, path to where you want to upload the file and Put it there
var task = new FirebaseStorage(
"your-bucket.appspot.com"
new FirebaseStorageOptions
{
AuthTokenAsyncFactory = () => Task.FromResult(a.FirebaseToken),
ThrowOnCancel = true,
})
.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;
```