执行此脚本文件夹后如何在 google-drive 中创建子文件夹
enter code here
$parentId=$par_idpath;
$file = new Google_DriveFile();
$file->setTitle($dir_name);
$mimeType= gdrive_files::$mime_types['folder'];
$file->setMimeType($mimeType);
// Set the parent folder.
if ($parentId )
{
$parent = new Google_ParentReference();
$parent->setId($parentId);
$file->setParents(array($parent));
}
try {
$createdFile = $service->files->insert($file, array(
'mimeType' => $mimeType,
));
} catch (Exception $e) {
$this->err=$e->getMessage();