Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/283.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/75.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 Listfiles()不显示驱动器文件,仅显示上载的文件_Php_Google Drive Api_Google Api Php Client - Fatal编程技术网

Php Listfiles()不显示驱动器文件,仅显示上载的文件

Php Listfiles()不显示驱动器文件,仅显示上载的文件,php,google-drive-api,google-api-php-client,Php,Google Drive Api,Google Api Php Client,我正在使用web应用程序帐户,当我使用该功能时 $files=$service->files->listFiles() 它仅显示API上传的文件,因此我无法在正在访问的驱动器中执行搜索或任何相关操作。这是API问题、范围问题还是其他问题?谢谢以下是我在脚本中使用的库 require_once 'google-api-php-client/src/Google/Client.php'; require_once 'google-api-php-client/src/Google/Service/O

我正在使用web应用程序帐户,当我使用该功能时
$files=$service->files->listFiles()
它仅显示API上传的文件,因此我无法在正在访问的驱动器中执行搜索或任何相关操作。这是API问题、范围问题还是其他问题?谢谢以下是我在脚本中使用的库

require_once 'google-api-php-client/src/Google/Client.php';
require_once 'google-api-php-client/src/Google/Service/Oauth2.php';
require_once 'google-api-php-client/src/Google/Service/Drive.php';
对于范围:

$client->addScope(
    "https://www.googleapis.com/auth/drive",
    "https://www.googleapis.com/auth/drive.file",
    "https://www.googleapis.com/auth/drive.appfolder");

“web应用程序帐户”是什么意思?它不是服务帐户,而是console.developers中web应用程序部分的客户端ID,用于获取凭据的.json。请尝试在中检查响应,看看是否仍然得到相同的结果。