谷歌云存储访问的公共URL被拒绝

问题描述 投票:0回答:1

我有此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个回答
2
投票

听起来您还没有将存储桶权限设置为公共权限?

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

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

© www.soinside.com 2019 - 2024. All rights reserved.