我正在尝试使用 Google Drive API 来执行简单的任务,例如
- 跨文件夹移动文件。
- 列出项目
移动文件夹。
据我所知,Google Drive API 不提供跨文件夹移动文件的方法。
使用/parent 和/children API 可以指定文件的父文件夹,但不适用于文件夹。此外,与文件关联的父属性不会将其移动到该文件夹下。它只是将父属性与文件关联起来(这对我的情况根本没有用)
最佳答案
Drive API V3 具有以下功能:
Moving files between folders
To add or remove parents for an existing file, use the
addParents
andremoveParents
query parameters on the files.update method.Both parameters may be used to move a file from one folder to another: https://developers.google.com/drive/v3/web/folder#inserting_a_file_in_a_folder
关于google-drive-api - 如何使用 Google Drive API 移动文件和文件夹?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12778925/