I am using google-api-php-client
Here's a bit where I upload the .jpg image.
$postbody = array("data" => $imgData);
$gso = new Google_StorageObject();
$gso->setName($imageName);
$contentType = 'image/jpg';
$gso->setContentType($contentType);
$resp = $objects->insert('bucket-name', $gso, $postbody);
When checking, $gsoContentType is added, but the application/octet-streamdefault type is added in the cloud console .
Is there any other way to set the content type?
source
share