So Google Drive has a lot of security, which is a good thing. By default, my app can only get the files it has itself created on the user's drive. However, I also need to be able to retrieve all files placed by the user (or another app) in one of the folders that my app created.
Example:
In addition, I have seen code on stackoverflow and other places which gives my app access to the user's ENTIRE google drive, but I'd like to avoid doing that. I only need access to the files created inside folders created by my app, not everything. Besides, the code that I found about this was all from 2012 or earlier and doesn't work anymore due to undocumented changes in the PHP API.
Any help would be appreciated.
答案 0 :(得分:0)
似乎不可能。我被迫让我的应用程序访问用户的整个驱动器。这是相关的代码:
$client->setScopes(implode(' ', array(
Google_Service_Drive::DRIVE,
)));
如果有人有更好的解决方案,我很乐意听到。
答案 1 :(得分:0)
用户需要使用您的应用打开新上传的文件,以便您可以访问它。我遇到了类似的问题并使用了此处描述的解决方法:Drive API for Android unable to access the file created by same App