I am new to firebase storage. Just so I could learn it, I made a simple app that has a button and an ImageView
. When I click on the button, an image (from
Firebase Storage Error (solved) 1. Go to firebase console under the project you are working on 2. Under storage on the firebase console and under rules edit the service firebase.storage to.
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
}
}
}
I am adding this answer hoping it will help someone, in Firebase:
go to "Storage"
Select "Rules" tab and edit rules as per below:
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
// Allow access by all users
allow read, write: if request.auth != null;
}
}
}
Note: make sure you have it exactly as above, do not replace {bucket} for your project name.
Update your security rules with match /{allPaths=**}
to indicate that public read and write access is allowed on all paths:
service firebase.storage {
match /b/savephoto-a1cc3.appspot.com/o {
match /{allPaths=**} {
// Allow access by all users
allow read, write;
}
}
}
Various default rules are provides in the tabs of the Sample Rules section of the documentation.
Follow these steps
Go to "Storage"
Select "Rules" tab and edit rules as per below:
//if your application have authentication feature(login) then use this:-
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if request.auth != null;
}
}
}
//if your application does not have login feature(directly any user can access storage) then use this:-
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
}
}
}