以下是labels.restricted
下的参数:
https://developers.google.com/drive/v2/reference/files/insert
但无法在PHP中编写代码几乎可以尝试所有内容,但仍会从google驱动器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
//
)
);
答案 0 :(得分:0)
您必须在标签上设置setRestricted:
$label = new Google_Service_Drive_DriveFileLabels();
$label->setRestricted(true);
$file->setLabels($label);