如何将xlsx文件上传到我自己的谷歌驱动器,然后将它们转换为谷歌电子表格并以编程方式获取可分享的链接? [英] How to upload xlsx files to my own google drive, then convert them to google spreadsheet and get the shareable link programmatically?

查看:626
本文介绍了如何将xlsx文件上传到我自己的谷歌驱动器,然后将它们转换为谷歌电子表格并以编程方式获取可分享的链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究node.js服务器。我想上传并将.xlsx文件转换为Google电子表格,然后通过编程方式获取可分享链接。

然而,我发现Google Drive api专门针对为其他用户构建应用程序以访问其驱动器以在您的应用程序上执行某些操作,但不能以编程方式访问自己的驱动器我是否正确地理解了这一点?



我已经阅读了很多关于google开发者的文档和一些关于这个的教程,但是我找不到我想要的东西。有什么办法可以做我想做的事吗?你可以给我一些指导吗?

>云端硬盘使用oauth2来处理目标云端硬盘帐户的标识和授权。具体而言,访问令牌包含(概念上并非字面上)Drive账户的ID。



所有已发布的示例都显示了如何获取第三方用户,因为这是更常见和更复杂的用例。为自己的帐户获取访问令牌要容易得多。

请参阅
如何在没有用户干预的情况下授权应用程序(Web或安装)? (规范?)


I'm working on a node.js server. I want to upload and convert .xlsx files to google spreadsheet in my own google drive and then get the shareable link programmatically.

However, I found google drive api is specialized for building app for other users to access their drives to do something on your app but not for accessing your own drive programmatically. Do I understand this correctly?

I have read a lot of documents on google developers and some tutorial about this but I cannot find the way to what I want. Is there any way to do what I want? Could you give me some guidelines?

解决方案

You have misunderstood.

Drive uses oauth2 to handle the identification and authorisation of the target Drive account. Specifically, the Access Token "contains" (conceptually, not literally) the Id of the Drive account.

All of the published examples show how to obtain an access token for a third party user because that is the more common and more complex use case. Obtaining an access token for your own account is much easier.

See How do I authorise an app (web or installed) without user intervention? (canonical ?)

这篇关于如何将xlsx文件上传到我自己的谷歌驱动器,然后将它们转换为谷歌电子表格并以编程方式获取可分享的链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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