The Google App Engine website (https://developers.google.com/appengine/docs/python/googlestorage/functions#seek) hints at being able to seek within files on Google Cloud Storage. However, on the Google Cloud Storage API pages there is no sign of being able to seek.
I wondered if it is possible to seek within files stored on Google Cloud Storage using the API, from non Google App Engine servers.
Use the Range header to do this.
The following will get six bytes 10, 11, 12, 13, 14 and 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]
Bytes start at 0 to (length - 1). So a 5 byte file contains bytes 0, 1, 2, 3 and 4.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With