可以使用Google Drive API将整个文件夹上传到Google Drive吗?

huangapple go评论46阅读模式
英文:

Is it possible to upload an entire folder to Google Drive using Google Drive API?

问题

我目前正在探索Google Drive API,能够成功使用Postman上传单个文件。

我尝试使用Google Drive API创建/上传文件夹,但失败了。实际上,我没有看到任何特定用于处理文件夹的API。我尝试使用创建文件的API。

参考链接 - https://developers.google.com/drive/api/v3/reference

将不胜感激任何帮助。

英文:

I am currently exploring Google Drive APIs and am able to upload an individual file using Postman successfully.

I tried to create/upload a folder using Google Drive API but failed. In fact, I don't see any specific API to deal with a folder. I was giving it a try with create files API.

Reference - https://developers.google.com/drive/api/v3/reference

Any help will be appreciated.

答案1

得分: 1

If you check the documentation for files.create you will notice at the top it states

创建文件。

This is singular each request creates a single file. If you want to upload a directory you will need to first create the directory then upload each file one at a time.

You could try batching but I don't think you can batch the file upload itself you could probably batch the metadata creation performance#details

英文:

If you check the documentation for files.create you will notice at the top it states

> Creates a file.

This is singular each request creates a single file. If you want to upload a directory you will need to first create the directory then upload each file one at a time.

You could try batching but I don't think you can batch the file upload itself you could probably batch the metadata creation performance#details

huangapple
  • 本文由 发表于 2023年2月10日 02:45:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/75403115.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定