https://cloud.google.com/appengine/docs/standard/python/blobstore/ describes exactly how to do this using AppEngine and Blobstore. And apparently the same API can be used to upload to Cloud Storage. I'm not able to use AppEngine for other reasons. I'm trying to use Cloud Run. And for anyone not using AppEngine, the Cloud Storage docs don't show any clear way to upload from a browser.
I want something like blobstore.create_upload_url
, but that API is only provided via the appengine libraries in the AppEngine runtime and are not available in other environments.
Cloud Storage has create_resumable_upload_session
, which creates an upload URL. But if you stick that in a browser form - the way you do with create_upload_url
- it doesn't issue a redirect back to the app after upload completion.