A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/step-up-labs/firebase-storage-dotnet below:

step-up-labs/firebase-storage-dotnet: C# library for Firebase Storage

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

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

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

// 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;

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4