默认情况下,将Google云端存储分区中的所有文件设置为公开 [英] Set all files in Google Cloud Storage Bucket to public by default

查看:563
本文介绍了默认情况下,将Google云端存储分区中的所有文件设置为公开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将上传到存储区的文件设置为默认公开。



编辑存储区权限时,我会看到下面的弹出窗口不明白,我找不到任何有关它的文档。如何为公众设置可用性?



'实体'选择框具有以下选项:域,组,用户,项目

当前设置似乎没有将文件设置为public,因为当我尝试通过使用 CloudStorageTools :: getPublicUrl($ fileName,false)获取的URL访问文件时, code>我得到:

 <错误> 
< Code> NoSuchKey< / Code>
<讯息>指定的密钥不存在。< / Message>
< / Error>

解决方案

您需要为此设置一个ACL:

gsutil defacl set public-read gs:// bucket


I am trying to set the files that are uploaded to a bucket to public by default.

When editing the bucket permissions, I get the popup below which I don't understand and I can't find any documentation about it. How do I set availability to the public?

The 'entity' selectboxes have the options: domain, group, user, project

The settings currently don't seem to set the files to public, because when I try to access a file through the url obtained with CloudStorageTools::getPublicUrl($fileName, false) I get:

<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
</Error>

解决方案

You;ll want to set an ACL for that:

gsutil defacl set public-read gs://bucket

这篇关于默认情况下,将Google云端存储分区中的所有文件设置为公开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆