Honestly, I'm really disappointed with the lack of a Google Cloud Storage document with PHP. Most of what I found here (Stackoverflow) is deprecated.
Here is my attempt:
$postbody = array('data' => file_get_contents('e.png')); $gso = new Google_Service_Storage_StorageObject(); $gso->setName('testing'); $gso->setContentType('images/png'); $service->objects->insert($bucket_name, $gso, $postbody);
Error message
(400) Send requests must be sent to / upload / *. Resend the request to the same path, but with the / upload prefix.
From the Google Cloud Storage JSON API, I understand that I need to use upload/storage/v1/b/bucket_name/o instead of storage/v1/b/bucket_name/o , but how can I do this using the Google Cloud Storage client API?
google-cloud-storage php
invisal
source share