如何上传到Google Cloud Storage


  1. 我如何上传到谷歌云存储桶,而不是Firebase存储?根据该文档,您获得Firebase存储和Cloud存储引用的方式似乎完全相同。但是,当我尝试从云功能访问桶时,我给出了两个选择(gcf-sources-234340858426-us-central1us.artifacts.233093489-23.appspot.com),这与Firebase Storage (gs://someaddress.appspot.com)完全不同。我现在可以用Firebase SDK从前端上传到Firebase存储。

  2. Firebase Storage可以触发谷歌云功能与事件触发器?

上传文件

云存储桶和Firebase桶在底层是一样的。也就是说,如果你想使用Google cloud特定的(即非firebase)方法,你可以使用客户端库或REST API。

触发功能是-你应该能够触发一个存储触发功能,通过上传文件到一个桶。部署命令可能如下所示:

# Note: this is untested, and assumes you have the Google Cloud SDK installed
gcloud functions deploy my-function --trigger-bucket "someaddress.appspot.com"

希望这对你有帮助!

最新更新