提问者:小点点

google cloud storage的公共URL访问被拒绝


我有此URL,但获得访问拒绝,有任何权限需要。

https://storage.googleapis.com/bucket/artboard_4.png

获取此错误:

Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object.

共1个答案

匿名用户

听起来您还没有将bucket权限设置为public?

在控制台中,您可以单击bucket菜单中的“Set bucket permissions”(设置bucket权限)。 在“添加成员和分配角色”中输入“allusers”->; 存储->; 存储对象查看器。

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