my issue is the following. When using the google drive api V3 and php to upload a file to google drive, the file uploaded is empty, with a filesize of 0 bytes. All the metadata uploads no problem.
session_start();
$file_tmp=$_SESSION['file_tmp'];
$drive = new Google_Service_Drive($client);
$data = file_get_contents($file_tmp);
$file = new Google_Service_Drive_DriveFile(array(
'data' => $data,
'mimeType' => $file_type,
'name' => $file_name,
'description'=>$lolol,
'uploadType' => 'multipart',
'parents' => array($folderID),
'uploadType' => 'multipart'
));
$createdFile = $drive->files->create($file);
For anyone wondering, if I echo $file_tmp I get a path such as /private/var/tmp/phpDpmi83 .(I got this from a html form with input type file)
Originally i didn't have an UploadType and other forums said that was the issue, but I added that and still nothing. Any suggestions?