【问题标题】:Public URL of google cloud storage access denied谷歌云存储访问的公共 URL 被拒绝
【发布时间】:2020-06-08 00:52:23
【问题描述】:

我有这个 URL,但访问被拒绝,需要任何权限。

https://storage.googleapis.com/BUCKET/Artboard_4.png

得到这个错误:

匿名调用者没有 storage.objects.get 访问 Google Cloud Storage 对象的权限。

【问题讨论】:

    标签: node.js angular google-cloud-platform google-cloud-storage


    【解决方案1】:

    您好像没有将存储桶权限设置为公开?

    在控制台中,您可以点击存储桶菜单中的“设置存储桶权限”。在添加成员中输入“allUsers”并分配角色 -> 存储 -> 存储对象查看器。

    使用 gsutil,运行 gsutil -m acl set -R -a public-read gs://bucket 应将对该存储桶中所有文件的访问权限设置为公开。要设置存储桶的默认权限,以便在添加文件时默认为公共文件,请使用gsutil defacl set public-read gs://bucket

    【讨论】:

    • 谢谢@jtiscione,这节省了我的时间。
    猜你喜欢
    • 1970-01-01
    • 2019-12-12
    • 2017-09-06
    • 2015-03-28
    • 2017-08-05
    • 2019-04-20
    • 1970-01-01
    • 2021-05-04
    • 1970-01-01
    相关资源
    最近更新 更多