Firebase存储规则禁止覆盖

时间:2017-04-13 12:49:08

标签: firebase firebase-security firebase-storage

我不希望用户能够上传存储中已存在同名的新文件,

以上是我尝试过的内容,但在上传不存在的文件时仍然会403

service firebase.storage {
  match /b/projectid/o {
    match /{allPaths=**} {
      allow read;
      allow write: if !resource || request.resource.name == resource.name;
    }
  }
}

1 个答案:

答案 0 :(得分:0)

我处于同样的情况,我使用客户端的uid + timestamp.png更改了文件名

相关问题