Firebase 3 Storage不允许文件更新/覆盖 [英] Firebase 3 Storage don't allow file updating/overwriting

查看:61
本文介绍了Firebase 3 Storage不允许文件更新/覆盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在用于Firebase 3存储的方法/规则来禁用文件更新或覆盖?

Is there a method/ruleset for Firebase 3 storage to disable file updating or overwriting?

我为数据库找到了data.exists(),但没有为存储找到解决方案.

I found data.exists() for Database but no solution for Storage.

推荐答案

TL; DR:在存储中安全规则 request.resource 〜= newData.val() resource 〜= data.val(),因此您可以类似地使用它们.

TL;DR: In Storage Security Rules, request.resource ~= newData.val() and resource ~= data.val(), so you can use them similarly.

service firebase.storage {
  match /b/<bucket>/o {
    match /path/to/file {
      allow write: if resource == null; // if !data.exists() in DB land
    }
  }
}

这篇关于Firebase 3 Storage不允许文件更新/覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆