如何在Firebase存储中创建文件夹? [英] How to create a folder in Firebase Storage?
问题描述
因此新的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屋!