Perhaps you could post your code here, without seeing your code, it will be difficult to help you.
Nov 23, 2021
7
Level 1
Cannot upload file to google drive using guzzle
I'm trying to upload files to drive (v3 api) by using guzzle, but it returns unsupported content error. the same request works fine in postman
Level 1
I used filesystem to resolve this issue
$client = new Client();
$headers = [
'Authorization' => 'Bearer '.$token,
];
$storeToDrive = $client->post('https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart', [
'multipart' => [
[
'name' => '',
'contents' => fopen('your meta file path', 'r'),
],
[
'name' => '',
'contents' => fopen('path of the file that you want to upload', 'r'),
]
],
'headers' => $headers,
]);
Please or to participate in this conversation.