Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/270.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#将PDF文件上载到Firebase项目存储中?_C#_File_Firebase_Firebase Storage - Fatal编程技术网

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

C#将PDF文件上载到Firebase项目存储中?,c#,file,firebase,firebase-storage,C#,File,Firebase,Firebase Storage,你们知道如何将PDF文件直接上传到Firebase项目存储中吗? 我在网上搜索了很多,但什么也没找到 有C#的图书馆吗?或者是否有C#和Firebase的文档 请帮帮我!谢谢 编辑: 好的,我找到了一个图书馆:FirebaseSharp 但是这个库只支持Firebase的早期版本,也不支持存储 试试图书馆 下面是一个示例用法: // Get any Stream - it can be FileStream, MemoryStream or any other type of Stream v

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

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

请帮帮我!谢谢

编辑:

好的,我找到了一个图书馆:FirebaseSharp

但是这个库只支持Firebase的早期版本,也不支持存储

试试图书馆

下面是一个示例用法:

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

还有一个相关问题。

目前发布的Firebase for Unity(这是我们唯一的c#客户端)还不支持存储。此外,Firebase存储没有REST api,我相信您引用的库是针对Firebase实时数据库的早期版本的,该版本不支持存储。您能否确认您正在寻求Unity支持?或者你在另一个平台上寻找C#支持?我只是在寻找Visual Studio的C#支持,以便将文件上载到我项目的Firebase存储中。我不是在寻求团结。我知道Unity得到了Firebase的官方支持。因此,如果没有任何REST Api用于存储,我将无能为力?是的,我引用的库是针对Firebase的早期版本的,并且也没有存储支持。Firebase存储相当于Google云存储,但增加了对第三方身份验证+规则的支持。如果您在安全的环境中运行并且可以使用服务帐户,请尝试查看我们的c#GCS库:这会导致403权限被拒绝,请添加如何验证执行上载的客户端。以下是官方youtube频道对403错误的通用解释。