在独立的Web应用程序使用谷歌驱动器SDK [英] Using Google Drive SDK in stand-alone web application
问题描述
我一直在工作分配了任务,一个谷歌用户的硬盘集成到我们自己的web应用程序,交换文件,并最终为我们的最终提供文件的一些自动同步从驱动器。
I have been assigned a task at work, to integrate a users Google Drive into our own web-app, to exchange files, and eventually provide some auto-syncing of files from Drive to our end.
我做了一些研究,在发现这篇文章:<一href=\"http://arstechnica.com/business/2012/04/google-drive-sdk-announced-but-apis-are-only-accesible-to-web-apps-for-now/\" rel=\"nofollow\">http://arstechnica.com/business/2012/04/google-drive-sdk-announced-but-apis-are-only-accesible-to-web-apps-for-now/
I did a some research at found this article: http://arstechnica.com/business/2012/04/google-drive-sdk-announced-but-apis-are-only-accesible-to-web-apps-for-now/
据指出,这是不可能制定了独立(这么说),web应用,使用户连接/验证其驱动帐户。也就是说,并非无需安装在我们的应用程序作为Web应用程序,比如谷歌Chrome,然后使用应用程序来传输文件的方式。
如果是这样的话,整个思路是丢失。
It states that it is not possible to develop a "stand-alone" (so to speak) webapplication, that lets users connect/authenticate their Drive account. That is, not without having to install our application as a Web App in, say Google Chrome, and then use the app to transfer files that way. If that's the case, the whole idea is lost.
谁能告诉我,这是真的吗?
Can somebody tell me if this is true?
推荐答案
据我可以告诉大家,看文件,没有。
As far I can tell, looking at the documentation, no.
您可以使用该驱动器的SDK,如你所愿:
You can use the drive SDK as you wish:
例如:
https://developers.google.com/drive/manage-uploads
POST /upload/drive/v2/files?uploadType=resumable HTTP/1.1
Host: www.googleapis.com
Authorization: **your_auth_token**
Content-Length: 38
Content-Type: application/json; charset=UTF-8
X-Upload-Content-Type: image/jpeg
X-Upload-Content-Length: 2000000
{
"title": "My Image"
}
您使用OAuth然后用上面的code令牌授权账户。
You authorise the account using OAuth then use that token in the code above.
在这里有一个看文档: https://developers.google.com/drive/关于-SDK ,并永远不要ArsTechnica的话吧;)
Have a look at the documentation here: https://developers.google.com/drive/about-sdk and never take ArsTechnica's word for it ;)
这篇关于在独立的Web应用程序使用谷歌驱动器SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!