如何将drive.file oauth2范围与Google云端硬盘中的文件夹一起使用? [英] How can I use the drive.file oauth2 scope with a folder in Google Drive?
问题描述
我正在使用一个网络应用程序,它将与用户在Google云端硬盘中的文件夹(而不是单个文件)一起使用.我想通过使用 drive.file
范围.我正在使用驱动器选择器UI 来允许用户选择一个文件夹,该文件夹与drive.file
并将文件夹添加到我的应用程序可以访问的文件夹列表中.
I'm working on a web app that will work with users' folders in Google Drive rather than individual files. I'd like to request the minimum permissions needed by using the drive.file
scope. I'm using the Drive picker UI to allow the user to select a folder, which works nicely with the drive.file
and adds the folder to the list of folders my app can access.
但是,问题在于,它仅授予对文件夹的访问权限,就好像它是单个文件一样,而没有递归地授予对用户选择的文件夹内的所有文件和子文件夹的访问权限.我的应用程序当前没有使用Drive UI为文件夹提供打开方式..."选项,因此我不知道这是否会授予正确的访问权限.
However, the problem is that it only grants access to the folder as if it were a single file, without also recursively granting access to all the files and subfolders inside the folder the user selected. My app currently doesn't with the Drive UI to provide an Open with... option for folders, so I don't know if that would grant the correct access permissions or not.
在使用drive.file
范围时如何使用Google云端硬盘选择器用户界面选择文件夹?
How can I use the Google Drive picker UI to select a folder while using the drive.file
scope?
推荐答案
If you're looking for folders using Drive Picker, can you try using the google.picker.ViewId.FOLDERS view? I've used the Drive Picker in my web app as well and I use google.picker.ViewId.DOCS_IMAGES
view because I'm working on image files. If this does not address your issue, it may not be supported yet.
这篇关于如何将drive.file oauth2范围与Google云端硬盘中的文件夹一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!