Reputation: 63
I try to upload some file to Firebase. But the console shows me this error:
{"code": 400, "message": "Permission denied. Could not access bucket educasys-e422a.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."}
My Firebase database (Educasys) rules:
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write;
}
}
}
What can I do?
Upvotes: 4
Views: 4618
Reputation: 101
Check these 3 things
storage rules should allow read write sample rule
In your code while initializing firebase storageBucket value should be like
firebase.initializeApp({storageBucket: 'your-project-id.appspot.com'});
If want to access some other bucket from the project then get the storage instance like below
var storage = firebase.app().storage("gs://my-custom-bucket");
source : https://firebase.google.com/docs/storage/web/start
Upvotes: 2
Reputation: 3633
I think you misunderstood something. FireStore is also database, don't get fooled by the name. It's a new database service by Firebase, it supports more features when compared to Firebase, e.g. More queries allowed, performance enhancement, etc.
You're trying to upload files to Firebase, therefore, don't go to FireStore, go to the storage
option on the left panel and change the rules there:
Then change your rules like this:
Upvotes: 6