Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在PHP中获得与Google Drive Api的共享链接_Php_Api_Google Cloud Platform_Drive - Fatal编程技术网

如何在PHP中获得与Google Drive Api的共享链接

如何在PHP中获得与Google Drive Api的共享链接,php,api,google-cloud-platform,drive,Php,Api,Google Cloud Platform,Drive,我正在使用php的谷歌驱动api。我确实在新创建的文件夹中上载了一个文件。但我不知道“如何才能获得新文件夹的共享url”。或者“我如何才能给予新电子邮件地址的“读者”权限” 我想共享一个文件夹。不归档 $result = $service->files->create( $file, array( 'data' => file_get_contents($file_path), 'mimeType' => 'applicat

我正在使用php的谷歌驱动api。我确实在新创建的文件夹中上载了一个文件。但我不知道“如何才能获得新文件夹的共享url”。或者“我如何才能给予新电子邮件地址的“读者”权限”

我想共享一个文件夹。不归档

$result = $service->files->create(
    $file,
    array(
        'data' => file_get_contents($file_path),
        'mimeType' => 'application/octet-stream',
    )
);
文件Id:
$fileId=$result['Id']