【问题标题】:Read files from Google Cloud Storage on App Engine从 App Engine 上的 Google Cloud Storage 读取文件
【发布时间】:2013-01-26 11:38:03
【问题描述】:

我正在使用 Google App Engine 开发一个应用程序。我需要从我的 Google Cloud Storage 中读取 PDF 文件。代码如下:

String filename = "...";
BlobstoreService blobstore = BlobstoreServiceFactory.getBlobstoreService();
BlobKey blobkey = blobstore.createGsBlobKey(filename);
blobstore.serve(blobkey, httpResponse);

仅当我在存储桶中的文件上设置“公开共享”时它才有效。不设置“公开分享”如何读取文件?

【问题讨论】:

    标签: google-app-engine google-cloud-storage


    【解决方案1】:

    您需要将应用的服务帐号添加到存储桶 acls。请参阅Google Cloud Storage Prerequisites 的第 5 节。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-22
      • 2015-07-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-02
      • 2015-09-26
      • 1970-01-01
      相关资源
      最近更新 更多