【问题标题】:Transferring from Blob to Cloud Storage从 Blob 传输到云存储
【发布时间】:2014-11-22 14:58:26
【问题描述】:

我已将我的 App-Engine 从 BlobStorage 转移到 Cloud-Storage。这适用于这些上传代码:

上传.py:

...
upload_url = blobstore.create_upload_url('/upload', gs_bucket_name="my-default-bucket")
...

我的上传模板.html:

...
<form action="{{ upload_url }}" method="POST" enctype="multipart/form-data">
    <input type="file" name="file">
    <input type="submit" name="submit" value="Submit">
</form>
...

上传.py:

class UploadBlobHandler(blobstore_handlers.BlobstoreUploadHandler):
  def post(self):
    file_info = self.get_file_infos()[0]
    self.response.out.write(file_info.gs_object_name)

    self.redirect("/download/serve" + file_info.gs_object_name)

效果很好。但它不仅在 Google Cloud Storage-Bucket 中上传。它也在 den Blob Storage 中上传。 (可以到https://appengine.google.com点击Blob Viewer查看。)

这是正确的方法吗?这样对吗?还是我有什么问题?

【问题讨论】:

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


    【解决方案1】:

    如果我对您的理解正确的话……您正在使用 Blobstore API 来保存到您的 Google 云存储?

    如果这是您正在做的事情,那么是的,您做得正确,是的,它会将您的文档副本保存在 Blobstore 中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-27
      • 1970-01-01
      • 2016-08-10
      • 1970-01-01
      • 1970-01-01
      • 2021-11-28
      • 2019-12-29
      • 2013-11-08
      相关资源
      最近更新 更多