首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >C#上传PDF文件到火基项目存储?

C#上传PDF文件到火基项目存储?
EN

Stack Overflow用户
提问于 2016-12-01 14:10:36
回答 1查看 8K关注 0票数 4

你们知道如何将PDF文件直接上传到Firebase项目存储中吗?我在网上搜了很多,但什么也没找到。

有C#的图书吗?或者有C#和Firebase的文档吗?

救救伙计们!谢谢

编辑:

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

https://github.com/bubbafat/FirebaseSharp

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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-01-05 12:54:24

尝试FirebaseStorage.net库。

下面是一个示例用法:

代码语言:javascript
运行
复制
// 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;

还有一个相关的博客帖子

票数 8
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40912779

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档