mardi 21 avril 2015

google drive php api HOW TO SET labels.restricted / want to restrict the file from Downloading

Here is the parameter, under labels.restricted :

http://ift.tt/W3uLVH

But cannot code it in PHP tried almost everything but still getting error from the google drive API.

$file = new Google_Service_Drive_DriveFile();
$file->setTitle(TESTFILE);

$file->setRestricted();

$result = $service->files->insert(
  $file,
  array(
    'data' => file_get_contents(TESTFILE),
    'mimeType' => 'application/octet-stream',
    'uploadType' => 'multipart'
    //
    // HERE SHOULD BE THE CODE FOR THE labels.restricted
    //
  )
);

Aucun commentaire:

Enregistrer un commentaire