Created
January 3, 2017 13:52
-
-
Save bezysoftware/3321d605cef3cde920e158451d467a0e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Get any Stream — it can be FileStream, MemoryStream or any other type of Stream | |
| var stream = File.Open(@"C:\YourFile.png", FileMode.Open); | |
| // Construct FirebaseStorage with 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 is completed and get the download url | |
| var downloadUrl = await task; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment