Search code examples
firebasegoogle-cloud-storagefirebase-security

Permission to use Firebase Cloud Storage has been refused. This operation could not be completed. When fetching a downloadURL, use firebase


I have such a code that publishes a picture to my online storage buckets properly.

I'd want to retrieve the picture's URL using another function so that I may display it on my page.

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

}


Solution

  • buddy this works great for me

    service firebase.storage {
       match /b/{bucket}/o {
       match /images/{imageId} {
       // Only allow uploads of any image file that's less than 5MB
       allow write: if request.resource.size < 5 * 1024 * 1024
               && request.resource.contentType.matches('image/.*');
        }
       }
     }