我正在尝试在firebase存储中上传图像。我一直在关注Firebase存储教程上传图像。如网站所述,我必须更改默认存储规则。因此,我将规则更改为:
service firebase.storage {
match /b/fir-storage-42411.firebaseio.com/o {
match /{allPaths=**} {
allow read, write: if true;
}
}
}
当我尝试发布规则时,我会收到以下错误:
Error saving rules - Line 1: Parse error.
尝试搜索错误,但找不到任何结果。
谢谢。
我看到的明显错误是您的规则应引用您的存储存储桶(fir-storage-42411.appspot.com
),而不是数据库(fir-storage-42411.firebaseio.com
)。除此之外,这应该是有效的(除非可能隐藏在那里的任何隐藏的特殊字符):
service firebase.storage {
match /b/fir-storage-42411.appspot.com/o {
match /{allPaths=**} {
allow read, write;
}
}
}