【问题标题】:Google Cloud Storage Client Library - Check Shared Publicly By Default谷歌云存储客户端库 - 勾选默认公开共享
【发布时间】:2013-08-31 01:22:23
【问题描述】:

我正在使用 Google 云存储客户端库将文件动态上传到其中并从中提供文件。上传部分工作正常。这没有问题。

我面临的问题是上传后,如果我尝试访问应用程序中的文件,则服务链接已损坏。

所以我去了谷歌云控制台,我注意到一件事是未选中“公开共享”。

如果我选中“公开共享”复选框,那么我可以在我的应用程序中访问该文件。

我已尝试使用 public-read 和 bucket-owner-full-control ACL。

这是我正在使用的代码..

GcsFileOptions options = new GcsFileOptions.Builder().cacheControl("public, max-age=31536000, no-transform").mimeType(mimeType).acl("bucket-owner-full-control").build();

你们能告诉我们我应该做哪些修改,以检查“公开共享”复选框。

【问题讨论】:

    标签: acl cache-control google-cloud-storage gsutil


    【解决方案1】:

    您希望文件公开吗?如果是这样,为什么不将 ACL 设置为 public-read 而不是 bucket-owner-full-control?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-21
      • 1970-01-01
      • 1970-01-01
      • 2018-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多