Upload file to google cloud storage

Is the file generated by the server or by the user? If the file is uploaded by the user, I would not bother uploading the file to your server and then forwarding it to the GCS bucket. Instead, I would generate a signed URL on the server, send that to the browser and let the browser upload the file directly to the bucket.

I describe two variants for creating such a signed URL on gcs_signed_url. The two variants differ in whether your application is running on the Google cloud itself or not.