这是我上传.jpg图像的位置.
$postbody = array("data" => $imgData);
$gso = new Google_StorageObject();
$gso->setName($imageName);
$contentType = 'image/jpg';
$gso->setContentType($contentType);
$resp = $objects->insert('bucket-name', $gso, $postbody);
Run Code Online (Sandbox Code Playgroud)
通过检查$gso正在添加ContentType,但在云控制台中添加了默认application/octet-stream类型.
有没有其他方法来设置内容类型?
我在PHP for App Engine上开始使用Laravel入门,当我在本地开发中将存储路径更改为Google云存储时,我遇到了错误.
恩.
const BUCKET_NAME = "bucket-name";
$storage_path = "gs://" . BUCKET_NAME . "/storage";
Run Code Online (Sandbox Code Playgroud)
这是ErrorException:
file_put_contents(/meta/services.json): failed to open stream: No such file or directory
Run Code Online (Sandbox Code Playgroud)