Skip to content Skip to sidebar Skip to footer

How Can I Get All Folders That Contain Images With The Google Drive Api?

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 inef

Solution 1:

You could try using the https://developers.google.com/drive/v2/reference/children/list with your mime-type query and run that for each folder. Which approach is more efficient will obv depend on your ratio of folders to files, and whether you already have a cache of folder ids.

Solution 2:

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.

Post a Comment for "How Can I Get All Folders That Contain Images With The Google Drive Api?"