dongyin0628 2018-12-13 08:14
浏览 41

如何使用PHP从Google Team Drive获取所有照片?

Is there any way to get all photos from Google team drive using PHP?

<?php 
require_once '/vendor/autoload.php';

$client = new Google_Client();
$client->setApplicationName('Google Drive API PHP Quickstart');
$client->setScopes(Google_Service_Drive::DRIVE);
$client->setAuthConfig(__DIR__ . '/themejson.json');
//$client->setAccessType('offline');
$service = new Google_Service_Drive($client);

$folderId = 'xxxxxxxxxxxxx';
// Print the names and IDs for up to 10 files.
$optParams = array(
  "q" => "'$folderId' in parents",
  'pageSize' => 20,
  'corpora' => "user,allTeamDrives",
  'includeTeamDriveItems' => true,
  'supportsTeamDrives' => true
);
$results = $service->files->listFiles($optParams);

if (count($results->getFiles()) == 0) {
    print "No files found.
";
} else {
    print "Files:
";
    foreach ($results->getFiles() as $file) {
        printf("%s (%s)
", $file->getName(), $file->getId());
    }
}
?>

I tried it with above code but it's not working properly. nothing return when I using above code

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
    • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
    • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
    • ¥15 如何在炒股软件中,爬到我想看的日k线
    • ¥15 seatunnel 怎么配置Elasticsearch
    • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
    • ¥15 (标签-MATLAB|关键词-多址)
    • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
    • ¥500 52810做蓝牙接受端
    • ¥15 基于PLC的三轴机械手程序