如何在Firebase存储中创建文件夹? [英] How to create a folder in Firebase Storage?

查看:145
本文介绍了如何在Firebase存储中创建文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此新的Firebase支持使用Google Cloud Platform进行存储。

So the new Firebase has support for storage using Google Cloud Platform.

您可以将文件上传到图片文件夹使用:

You can upload a file to the images folder using:

var uploadTask = storageRef.child('images').put(file, metadata);

如果你想创建一个子文件夹怎么办 images / user1234 动态使用代码?

What if you want to create a subfolder images/user1234 dynamically using code?

官方示例未显示如何执行此操作,也未显示官方指南参考文档

The offical sample does not show how to do that, nor the official guide or reference docs.

Firebase控制台是唯一可以创建文件夹的地方手动

Is the Firebase Console the only place where folders can be created manually?

推荐答案

Firebase控制台允许您创建一个文件夹,因为这是将文件添加到特定文件夹的最简单方法。

The Firebase Console does allow you to create a folder, since it's the easiest way to add files to a specific folder there.

但是没有公共API来创建文件夹。而是在向其添加文件时自动创建文件夹。

But there is no public API to create a folder. Instead folders are auto-created as you add files to them.

这篇关于如何在Firebase存储中创建文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆