Getting 403 Forbidden error when trying to load image from Firebase Storage

前端 未结 4 1557
旧巷少年郎
旧巷少年郎 2021-02-07 13:59

I\'m using firebase storage to store and load images for users on my android app. All users must be authenticated before using it. Occasionally, some user profile images are not

4条回答
  •  Happy的楠姐
    2021-02-07 14:42

    You get the following error if the extension of your file is either incorrect or missing:

     {
        "error": {
        "code": 403,
        "message": "Permission denied. Could not perform this operation"
        }
     }
    

    In the image URL you provided there is no extension for the image after the image name.

    I have tested with one of my urls, this works (you can test): https://firebasestorage.googleapis.com/v0/b/training-a0a3e.appspot.com/o/penguin-56101_640.jpg?alt=media&token=8dfb913d-e2f3-4956-bd3a-2c3746d0d6d3

    However when the .jpg is removed: https://firebasestorage.googleapis.com/v0/b/training-a0a3e.appspot.com/o/penguin-56101_640?alt=media&token=8dfb913d-e2f3-4956-bd3a-2c3746d0d6d3

    The following response is received:

     {
        "error": {
        "code": 403,
        "message": "Permission denied. Could not perform this operation"
        }
     }
    

提交回复
热议问题