I cant seem to update file in google drive with the following code, everything goes fine but file remains untouched? I am working with v3 api.
function updateFile($service, $fileId, $data) {
try {
$emptyFile = new Google_Service_Drive_DriveFile();
$file = $service->files->get($fileId);
$service->files->update($fileId, $emptyFile, array(
'data' => $data,
'mimeType' => 'text/csv',
'uploadType' => 'multipart'
));
} catch (Exception $e) {
print "An error occurred: " . $e->getMessage();
}
}