C# 将 PDF 文件上传到 Firebase 项目存储?

4 c# file firebase firebase-storage

你们知道如何将 PDF 文件直接上传到 Firebase 项目存储吗?我在互联网上搜索了很多,但一无所获。

是否有一些 C# 库?或者是否有 C# 和 Firebase 的文档?

请帮助伙计们!谢谢

编辑:

好的,我找到了一个库:FirebaseSharp。

https://github.com/bubbafat/FirebaseSharp

但是这个 Lib 只支持以前版本的 Firebase,也不支持存储。

Tom*_*ška 8

试试FirebaseStorage.net库。

这是一个示例用法:

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

// Construct 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;
Run Code Online (Sandbox Code Playgroud)

还有一篇相关的博客文章