如何使用Google Drive API获取包含图片的所有文件夹? [英] How can I get all folders that contain images with the Google Drive API?

查看:303
本文介绍了如何使用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.

这篇关于如何使用Google Drive API获取包含图片的所有文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆