5

I don't want user to be able upload a new file which is already exist with the same name in storage,

Here is what I've tried but still getting 403 when I upload a nonexist file.

service firebase.storage {
  match /b/projectid/o {
    match /{allPaths=**} {
      allow read;
      allow write: if !resource || request.resource.name == resource.name;
    }
  }
}
Okan Kocyigit
  • 13,203
  • 18
  • 70
  • 129

1 Answers1

0

i was at the same situation and i changed the file name using the uid+timestamp.png at the client side

Oussema Aroua
  • 5,225
  • 1
  • 24
  • 44