Gen*_*sco 7 http-status-code-400 firebase-security firebase-storage
当我试图上传照片时,我的反应项目中我的firebase存储上传400错误导致消息错误消息错误...一切正常工作并成功上传图片,但现在它停止上传照片,发出以下错误,我不知道问题出在哪里......
提示检查的链接
POST https://firebasestorage.googleapis.com/v0/b/xxxxx-****.appspot.com/o?name=usertemp%2F0rdrGK4MRDRptAMCc3mHDveytJv1%2F0rdrGK4MRDRptAMCc3mHDveytJv1.jpg 400 ()
Run Code Online (Sandbox Code Playgroud)
这是链接响应的错误
{
"error": {
"code": 400,
"message": "Permission denied. Could not access bucket xxxxx-****.appspot.com. Please enable Firebase Storage for your bucket by visiting the Storage tab in the Firebase Console and ensure that you have sufficient permission to properly provision resources."
}
Run Code Online (Sandbox Code Playgroud)
这是我的安全
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if request.auth!=null;
}
}
}
Run Code Online (Sandbox Code Playgroud)
我仍然试图改变match到/b/xxxxx-****.appspot.com/o与仍然没有成功
gob*_*lin 15
这是由于缺少权限.你需要检查一下你是否有
firebase-storage@system.gserviceaccount.com
作为具有"Storage Admin"角色的成员.如果您没有,请添加它.这将解决问题.
以下是有关如何检查和添加权限的步骤.
如果需要,您还可以在IAM和管理员中添加缺少的权限.
当您在创建特定于文件上传的Firebase 存储之前尝试上传图像时,会发生此错误。
无法访问存储桶 xxxxx-****.appspot.com。请访问 Firebase 控制台中的存储选项卡,为您的存储桶启用 Firebase 存储,并确保您有足够的权限来正确配置资源
这就是您面临消息错误的Please Enable Firebase Storage for your bucket原因,因为 Firebase 存储充当存储桶媒体上传的默认位置。
{
"error": {
"code": 400,
"message": "Permission denied. Could not access bucket xxxxx-****.appspot.com. Please enable Firebase Storage for your bucket by visiting the Storage tab in the Firebase Console and ensure that you have sufficient permission to properly provision resources."
}
Run Code Online (Sandbox Code Playgroud)
该怎么办?
只需转到您的项目Firebase 控制台 >> 存储 >>并点击开始

| 归档时间: |
|
| 查看次数: |
5928 次 |
| 最近记录: |