Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to upload files directly to the Google Cloud Storage?

I have written a file upload for larger files that is uploading the files to the Cloud Storage. Unfortunately this takes a while, because the Files are uploaded to the web server first, and then again from the web server to the Google Cloud Storage. Is there a way to upload files directly to the Cloud Storage with the Google PHP Api Client (https://github.com/google/google-api-php-client)? I couldn't find anything on this topic in the docs.

like image 733
dominikweber Avatar asked Sep 28 '22 03:09

dominikweber


1 Answers

You need to create an upload URL with the name of your bucket, and the upload will go directly into that bucket.

https://cloud.google.com/appengine/docs/php/googlestorage/user_upload

like image 105
Andrei Volgin Avatar answered Oct 03 '22 00:10

Andrei Volgin