I need to get the file size by id with google drive API v3 and php. I use google drive API client library v3. I can connect to google disk but I don't know how to get one file size by its id.
I need to get the file size by id with google drive API v3 and php. I use google drive API client library v3. I can connect to google disk but I don't know how to get one file size by its id.
I'm sorry, it was just sleepless night.
$drive = new Google_Service_Drive($client);
$file_id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$optpParams = array(
'fields' => "size"
);
$response = $drive->files->get($file_id, $optpParams);
echo $response->size;