gpt4 book ai didi

google-drive-api - 如何使用 Google Drive API 移动文件和文件夹?

转载 作者:行者123 更新时间:2023-12-02 21:52:09 27 4
gpt4 key购买 nike

我正在尝试使用 Google Drive API 来执行简单的任务,例如

  1. 跨文件夹移动文件。
  2. 列出项目

移动文件夹。

据我所知,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 and removeParents 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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com