How to list all files, folders, subfolders and subfiles of a Google drive folder

后端 未结 2 1617
我在风中等你
我在风中等你 2021-01-03 17:12

Any ideas how to query for all the children and the children of the children in a single query?

Update

It seems like a simple question. I d

相关标签:
2条回答
  • 2021-01-03 17:39

    I think you have the right idea in your "update". Treat Drive as flat, make calls to list everything, and generate your own tree from that.

    0 讨论(0)
  • 2021-01-03 17:45

    I'm trying to do the same in PHP. My solution is:

    1. Retrieve the complete list of files and folders from the drive
    2. Make a double iteration (nested) on the retrieved json:
      • the first over the elements in "items" array,
      • the second (recursive) over the parents id of each element,

    rejecting all the elements that not contain the id of my specific folder in its parents id list.
    Don't worry, it's just one Google APIs call. The rest of the job is local.

    0 讨论(0)
提交回复
热议问题