【问题标题】:Google Cloud Storage seeking within files谷歌云存储在文件中寻找
【发布时间】:2012-12-24 06:35:06
【问题描述】:

Google App Engine 网站 (https://developers.google.com/appengine/docs/python/googlestorage/functions#seek) 暗示能够在 Google Cloud Storage 上的文件中进行查找。但是,在 Google Cloud Storage API 页面上没有可以搜索的迹象。

我想知道是否可以使用 API 从非 Google App Engine 服务器搜索存储在 Google Cloud Storage 上的文件。

【问题讨论】:

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


    【解决方案1】:

    使用Range 标头来执行此操作。

    下面会得到六个字节10、11、12、13、14和15

    curl -v -H "Range: bytes=10-15" http://storage.googleapis.com/pub/gsutil.tar.gz
    
    > GET /pub/gsutil.tar.gz HTTP/1.1
    > Host: storage.googleapis.com
    > Accept: */*
    > Range: bytes=10-15
    >
    HTTP/1.1 206 Partial Content
    < Content-Range: bytes 10-15/1092318
    < Content-Length: 6
    { [data not shown]
    

    字节从 0 到(长度 - 1)开始。所以一个 5 字节的文件包含字节 0、1、2、3 和 4。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-10
      • 1970-01-01
      • 1970-01-01
      • 2016-10-12
      • 1970-01-01
      相关资源
      最近更新 更多