如何检查Firebase存储中是否存在文件? [英] how to check if file exists in Firebase Storage?
问题描述
在使用数据库时,您可以执行 snapshot.exists()
来检查是否存在某些数据。根据文档,没有类似的存储方法。
https://firebase.google.com/docs/reference/js/firebase.storage.Reference
<如何检查Firebase存储中是否存在某个文件?
我相信FB存储API用户只能请求一个存在的文件。
因此,一个不存在的文件将不得不作为一个错误处理:
< a href =https://firebase.google.com/docs/storage/web/handle-errors =nofollow> https://firebase.google.com/docs/storage/web/handle-errors
When using the database you can do snapshot.exists()
to check if certain data exists. According to the docs there isn't a similar method with storage.
https://firebase.google.com/docs/reference/js/firebase.storage.Reference
What is the proper way of checking if a certain file exists in Firebase Storage?
I believe that the FB storage API is setup in a way that the user only request a file that exists.
Thus a non-existing file will have to be handled as an error: https://firebase.google.com/docs/storage/web/handle-errors
这篇关于如何检查Firebase存储中是否存在文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!