【发布时间】:2020-12-22 06:59:18
【问题描述】:
firebase 存储的官方文档没有规定显示 文件夹,它只提供了 file。那么在这种情况下我该怎么办呢。
【问题讨论】:
-
欢迎来到社区,请在发布问题前阅读this
标签: javascript firebase-storage
firebase 存储的官方文档没有规定显示 文件夹,它只提供了 file。那么在这种情况下我该怎么办呢。
【问题讨论】:
标签: javascript firebase-storage
这是不正确的 - 它确实允许您显示嵌套前缀(您称之为文件夹)。 documentation 在提供的示例代码中说明了这一点:
listRef.listAll().then(function(res) {
res.prefixes.forEach(function(folderRef) {
// All the prefixes under listRef.
// You may call listAll() recursively on them.
});
res.items.forEach(function(itemRef) {
// All the items under listRef.
});
}).catch(function(error) {
// Uh-oh, an error occurred!
});
在上面,res.prefixes 包含嵌套在列出的前缀下的前缀列表。请注意,我使用了正确的术语“前缀”。 Cloud Storage 并没有真正的“文件夹”。
【讨论】: