I am new to firebase storage. Can anyone tell me how to make the storage files public for reading and writing?. The default code provided by firebase is given below. What changes should I make ?
我是firebase存储的新手。谁能告诉我如何将存储文件公开用于读写? firebase提供的默认代码如下所示。我应该做些什么改变?
service firebase.storage {
match /b/image-view-b1cf5.appspot.com/o {
match /{allPaths=**} {
allow read, write: if request.auth != null;
}
}
}
4 个解决方案
#1
11
The documentation explains that if no rule expression is provided, the rule evaluates to true:
该文档说明如果未提供规则表达式,则规则的计算结果为true:
service firebase.storage {
match /b/image-view-b1cf5.appspot.com/o {
match /{allPaths=**} {
// Allow access by all users
allow read, write;
}
}
}
#2
25
FYI: if you want public read only.
仅供参考:如果您想要公开阅读。
service firebase.storage {
match /b/image-view-b1cf5.appspot.com/o {
match /{allPaths=**} {
allow read;
allow write: if request.auth != null;
}
}
}
#3
1
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
}
}
}
#4
-1
By default firebase storage is public.
默认情况下,firebase存储是公共的。
#1
11
The documentation explains that if no rule expression is provided, the rule evaluates to true:
该文档说明如果未提供规则表达式,则规则的计算结果为true:
service firebase.storage {
match /b/image-view-b1cf5.appspot.com/o {
match /{allPaths=**} {
// Allow access by all users
allow read, write;
}
}
}
#2
25
FYI: if you want public read only.
仅供参考:如果您想要公开阅读。
service firebase.storage {
match /b/image-view-b1cf5.appspot.com/o {
match /{allPaths=**} {
allow read;
allow write: if request.auth != null;
}
}
}
#3
1
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
}
}
}
#4
-1
By default firebase storage is public.
默认情况下,firebase存储是公共的。