且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Firebase:匿名上传文件而无需身份验证

更新时间:2023-12-04 10:18:34

要使用Cloud Storage for Firebase,您需要:

In order to use Cloud Storage for Firebase, you need to either:

  • 启用Firebase身份验证
  • 设置安全规则以允许未经身份验证的访问

要启用身份验证,请按照文档中的说明进行操作;否则,您可以遵循安全规则文档,并将您的规则设置为公开访问在开发过程中:

To enable auth, follow the instructions in the docs; otherwise, you can follow the security rules docs and set your rules to public access during development:

service firebase.storage {
  match /b/{bucket}/o {
    match /{allObjects=**} {
      // public read, write access!
      // don't use this in production!!!
      allow read, write;
    }
  }
}