你们知道如何将 PDF 文件直接上传到 Firebase 项目存储吗?
我在互联网上搜索了很多,但一无所获。
有一些 C# 的库吗?或者有 C# 和 Firebase 的文档吗?
请大家帮忙!谢谢
EDIT:
好的,我找到了一个库:FirebaseSharp。
https://github.com/bubbafat/FirebaseSharp
但该库仅支持以前版本的 Firebase,也没有存储支持。
Try 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;
还有一个相关的博客文章.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)