如何从我的网站上Google驱动器上载文件? [英] How to upload file on google drive from my website?
问题描述
我想使用Google驱动器API通过带有上载按钮的Web应用程序来上载文件.该应用程序的后端使用 Laravel API 和 mongodb 构建,前端使用 angularJs 构建.我的最终目标是将用户要上传的文件存储到公司的Google驱动器文件夹中,而不是存储到公司的Google驱动器文件夹中(例如Google文件选择器等).关于API,我是新手,因此任何建议都将对您有所帮助.
I want to use the Google drive API to upload files using my web app with an upload button. The back-end of the app is built with Laravel API and mongodb, and the front-end with angularJs. My end goal is for the file the user is uploading to be stored to a company's Google drive folder, not the user's (like Google file picker etc.) I'm a beginner when it comes to API, so any suggestions would be helpful.
推荐答案
您可以使用服务帐户和Google OAuth 2.0将文件上传到公司帐户.
You can use a service account and Google OAuth 2.0 to upload files to a company account.
参考链接: https://developers.google.com/accounts/docs/OAuth2ServiceAccount
服务帐户确实有局限性.
A service Account does have limitations.
For an alternative approach refer to this link : How do I authorise an app (web or installed) without user intervention?
这篇关于如何从我的网站上Google驱动器上载文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!