Using Google Cloud Storage, I'd like to pass a client the necessary information to do a resumable upload. Is this possible?
2 Answers
Yes, this is possible.
With a server that has authenticated to the Cloud Storage service and a client it wishes to grant access to, the typical signed URL upload workflow looks like this:
- Client requests a signature so it can do a PUT
- Your server creates and returns a signed
URL
using the method described here - Client does a PUT with the returned
URL
The resumable workflow looks like this:
- Client requests a signature so it can do a PUT
- Your server does creates and returns a signed
URL
using the method described here - Your server makes a POST request to initiate the resumable upload as described here
- Your server returns both the
URL
and theUpload ID
to the client - Client does one or more PUTs using the provided
URL
andUpload ID

- 22,457
- 2
- 40
- 49
-
Would you mind to share how you PUT a file to the signed url perhaps with javascript or jQuery? – Nimit Pattanasri May 09 '13 at 15:57
-
I don't have any javascript sample code handy, but you can take a look at this: http://stackoverflow.com/questions/2153917/how-to-send-a-put-delete-request-in-jquery – Benson Jun 10 '13 at 00:37
-
the link in step 3 of the resumable workflow points to the top-level google storage docs, now. Might be more helpful if it went straight to the resumable uploads pages to which you are referring. – ThatsAMorais Jan 11 '18 at 18:18
-
@Benson Is it possibly to do a resumable *download* from a signed URL also? And how? – zd5151 Aug 07 '22 at 15:31
I just found this note on the docs here:
Note: If your users are only uploading resources (writing) to an access-controlled bucket, you can use the resumable uploads functionality of Google Cloud Storage, and avoid signing URLs or requiring a Google account. In a resumable upload scenario, your (server-side) code authenticates and initiates an upload to Google Cloud Storage without actually uploading any data. The initiation request returns an upload ID, which can then be used in a client request to upload the data. The client request does not need to be signed because the upload ID, in effect, acts as an authentication token. If you choose this path, be sure to transmit the upload ID over HTTPS.
So basically you don't need a signed url. The upload ID would be enough. The procedure would be as follows:
- Client requests an upload so it can do a PUT
- Your server makes a POST request to initiate the resumable upload.
- Your server returns the upload id to the client.
- Client does a PUT to upload the file using the provided upload id.

- 4,381
- 2
- 29
- 48
-
2this no longer exists in the docs. What I found in [another page](https://cloud.google.com/storage/docs/access-control/signed-urls#signing-resumable) is that "Resumable uploads are pinned in the region they start in. [...] For example, if you create a resumable upload URL in the US and give it to a client in Asia, the upload still goes through the US. [...] To avoid this, have the initial POST request constructed and signed by the server, but then give the signed URL to the client so that the upload is initiated from their location. – Kostis Jul 23 '20 at 16:09