Syl*_*lph 3 php google-drive-api
我正在尝试列出带有根目录的文件夹,用户可以在其中选择要上传文件或根目录的文件夹。
我可以通过将查询放在下面的这一行中来实现这一点吗?
$files = $service->files->listFiles($parameters);
Run Code Online (Sandbox Code Playgroud)
提前致谢
小智 5
您应该能够简单地使用带参数的Files.list?q=列出带有根目录的文件夹。
它看起来像这样: q:mimeType='application/vnd.google-apps.folder' and 'root' in parents and trashed=false
在上面的查询中,它根据3个条件进行过滤。
您可以在此处尝试测试查询。
在PHP代码中,将是这样的:
$parameters['q'] = "mimeType='application/vnd.google-apps.folder' and 'root' in parents and trashed=false"
$files = $service->files->listFiles($parameters);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3453 次 |
| 最近记录: |