I am having serious issues with the documentation for the new google drive API client library. It seems this should be an easy one to answer without having to put it on stackoverflow. I am seriously considering rolling my own on this one, a 64 page library that "just works" is so far a "total headache"
How the heck do you set the uploadType to "resumable" instead of the default "simple". I have searched the library for a way to do this, but it seems non-existent. Their only hint is the code on their sample uploader page https://developers.google.com/drive/quickstart-php
//Insert a file
$file = new Google_DriveFile();
$file->setTitle('My document');
$file->setDescription('A test document');
$file->setMimeType('text/plain');
$data = file_get_contents('document.txt');
$createdFile = $service->files->insert($file, array(
'data' => $data,
'mimeType' => 'text/plain',
));
Nothing here sets the uploadType...???
Their docs on another page just show uploadType as a part of the address as a GET: https://www.googleapis.com/upload/drive/v2/files?uploadType=resumable
but when you use $service->files->insert
, the library sets the address.