How do I create a Google Cloud Storage resumable URL using the Google Client Library for Java on App Engine?


Kilogram.

I found the following instructions which describe exactly what I want to do:

Note : If your users only upload (write) resources to an access-controlled bucket, you can use Google Cloud Storage's resumable upload feature and avoid signing URLs or requiring a Google account. In the resumable upload scenario, your (server-side) code authenticates and initiates the upload to Google Cloud Storage without actually uploading any data. The initial request returns an upload ID, which can then be used in client requests to upload data. Client requests don't need to be signed, as the upload ID actually acts as an authentication token. If you choose this path, make sure to transmit the upload ID over HTTPS.

https://cloud.google.com/storage/docs/access-control#Signed-URLs

However, I can't figure out how to do this with Java's Google Cloud Repository.

https://developers.google.com/resources/api-libraries/documentation/storage/v1/java/latest/

I can't find any reference to a recoverable file, nor the URL of the file anywhere in that API. How can I do this?

Brandon Jaber

The library doesn't expose the URLs it creates to the caller, which means you can't use it for this task. If you want to use signed URLs or the tricks mentioned above, you need to do it manually.

If possible, I recommend using a signed URL solution instead of a server-initialized resumable upload solution. It's more flexible and easier to get right, with the latter approach you might run into some odd situations.

Someone came up with a short example of signing URLs from App Engine in another question shortly: Cloud Storage and Secure Download Policies on App Engine . GCS ACL or Blobstore

Related


Google Cloud Storage with App Engine

Tanville It's driving me crazy, someone please help me here. This google cloud stuff confuses me. I'm going a little off here, and my understanding is a bit missing. I want to use cloud storage. Right now I have a default Android Studio project that has an and

Google Cloud Storage with App Engine

Tanville It's driving me crazy, someone please help me here. This google cloud stuff confuses me. I'm going a little off here, and my understanding is a bit missing. I want to use cloud storage. Right now I have a default Android Studio project that has an and

Google Cloud: Storage and App Engine

Kay I have a web application that has a frontend (React) and a backend (Express), so in my local environment the frontend runs on localhost:8080 and the backend runs on localhost:3000. I can deploy the backend server to App Engine running at https://[app_name]

Google Cloud Storage with App Engine

Tanville It's driving me crazy, someone please help me here. This google cloud stuff confuses me. I'm going a little off here, and my understanding is a bit missing. I want to use cloud storage. Right now I have a default Android Studio project that has an and

Google Cloud Storage with App Engine

Tanville It's driving me crazy, someone please help me here. This google cloud stuff confuses me. I'm going a little off here, and my understanding is a bit missing. I want to use cloud storage. Right now I have a default Android Studio project that has an and

Google Cloud Storage with App Engine

Tanville It's driving me crazy, someone please help me here. This google cloud stuff confuses me. I'm going a little off here, and my understanding is a bit missing. I want to use cloud storage. Right now I have a default Android Studio project that has an and