Error saving rules in Firebase Storage

4.8k views Asked by At

I am trying to upload images in Firebase storage. I have been following Firebase Storage Tutorial to upload images. As mentioned in the website, I have to change the default Storage rules. So, I changed the rules to :

service firebase.storage {
  match /b/fir-storage-42411.firebaseio.com/o {
    match /{allPaths=**} {
      allow read, write: if true;
    }
  }
}

When I am trying to Publish the rules, I am getting the following error :

Error saving rules - Line 1: Parse error.

Tried to google the error, but could not find any result.

Thanks.

1

There are 1 answers

1
Mike McDonald On

The obvious error that I see is that your rules should reference your storage bucket (fir-storage-42411.appspot.com), not your database (fir-storage-42411.firebaseio.com). Beyond that, this should be valid (barring any hidden special characters that might be hidden there):

service firebase.storage {
  match /b/fir-storage-42411.appspot.com/o {
    match /{allPaths=**} {
      allow read, write;
    }
  }
}