I set up a firebase web project and cannot get the storage upload to work. I followed the instructions in firebase documentation.
My storage bucket permissions are public (and there's no difference if I change {bucket}
to the actual name)
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
}
}
}
My code is
export function upload (fileName, file) {
let ref = firebase.storage().ref()
ref.child(fileName).putString(file, 'data_url').then(snapshot => {
console.log('Uploaded file')
}).catch(e => console.error(e))
And the error is
{
"error": {
"code": 400,
"message": "Bad Request. Could not access bucket xx-xxx.appspot.com"
}
}
I've tried to play around with the bucket permissions and I tried to add permissions in the google cloud storage as described here, which didn't help. Any ideas would be appreciated!