上传文件到谷歌驱动器,无需人工交互通过SDK [英] upload file to google drive without human interaction via SDK

查看:281
本文介绍了上传文件到谷歌驱动器,无需人工交互通过SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想上传文件到谷歌驱动器。我使用的是C#,并提及以下链接以开始使用:


  1. https://developers.google.com/drive/v3/web/quickstart/dotnet

  2. https://developers.google.com/drive/v3/web/manage上传

我可以成功上传文件到谷歌驱动器,但我主要关心的是我没有想要显示任何类型的UI /人机交互。它应该能够自动上传文件。



使用OAuth2.0需要我们管理和生成访问/刷新令牌。我不知道应该如何管理这些应用程序。



没有其他方法可以让用户通过分享他/她的Gmail帐户以编程方式访问Google Drive用户名/密码实现这一目标?

解决方案

是否有任何其他方式,用户可以访问谷歌通过分享他/她的Gmail帐户用户名/密码来达到这个目的,以编程方式驱动?

不存在



用户需要一次授权您的应用程序。之后,您可以保存刷新令牌并将其用于未来的无人值守使用。


I want to upload files to google drive. I'm using C# and have referred following links to get started

  1. https://developers.google.com/drive/v3/web/quickstart/dotnet
  2. https://developers.google.com/drive/v3/web/manage-uploads

I'm able to upload the file successfully to google drive but my main concern is I don't want to display any sort of UI/human interaction. It should be able to automatically upload the file.

Using OAuth2.0 there is a need that we have to manage and generate access/refresh token. I have no idea how these should be managed.

Isn't there any other way where the user can have access to google drive programmatically just by sharing his/her Gmail account username/password to achieve this?

解决方案

Isn't there any other way where the user can have access to google drive programmatically just by sharing his/her Gmail account username/password to achieve this?

No there is not

The user needs to authorise your app one time. After that, you can save Refresh Token and use that for future unattended use.

这篇关于上传文件到谷歌驱动器,无需人工交互通过SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆