如何使用Google Drive API获取包含图片的所有文件夹?

问题描述:

目前我这样做的方式是获取mimeType中包含/ image的所有文件的列表,并保存它们所在的所有唯一文件夹ID。这非常低效。我希望有一个查询,我可以在请求中指定会做同样的事情,但无法弄清楚。我正在使用直接的JavaScript来执行XMLHttp请求。

The way I am currently doing this is to get a list of all files that contain "/image" in their mimeType and saving all the unique folder IDs that they are in. This is horribly inefficient. I was hoping there was a query I could specify in the request that would do the same, but cannot figure it out. I am using straight JavaScript to do the XMLHttp requests.

目前无法根据内容搜索文件夹(请参阅搜索查询文档)。通过设置字段参数为 items / parents / id ,您可以优化您的过程,从而消除了获取和传输未使用的字段。

It currently isn't possible to search for folders based upon their contents (see search query documentation). You can optimize your process some by setting the fields parameter to items/parents/id, eliminating the fetching and transmission of unused fields.