问题描述
我可以轻松删除子引用中的文件,但是如何从Firebase存储中删除整个文件夹?
($ error)
print(error)
$
错误文件不存在。有什么想法吗?解决方案长话短说,我们还没有实现递归(或文件夹)删除。本主题在另一篇文章中进行了介绍:
现在,我们建议将文件列表存储在另一个源(如实时数据库)中,并根据需要删除文件。您也可以在Firebase控制台(console.firebase.google.com)中执行这种类型的删除。
将来,我们可能会提供这种功能,但没有完全规定出来。
I can easily delete a file within a child reference, but how would I delete the entire folder from Firebase Storage?
let postRef = FIRStorage.storage().reference().child("posts/folderName")
postRef.deleteWithCompletion { (error) in
print(error)
}
Error file does not exists. Any ideas?
Long story short, we haven't implemented a recursive (or folder) delete. This topic is covered in another post: FirebaseStorage: How to Delete Directory
For now, we recommend storing a list of files in another source (like the Realtime Database) and deleting files as necessary. You can also perform this type of delete in the Firebase Console (console.firebase.google.com).
In the future, we may offer this sort of functionality, but don't have it fully spec'ed out.
这篇关于从Firebase存储中删除包含内容的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!