简体   繁体   English

通过DRIVE API远程上传到Google Drive

[英]Remote Upload To Google Drive by DRIVE API

How to upload a file to Google Drive using the API by a url(Remote Upload)? 如何通过url(远程上传)使用API​​将文件上传到Google云端硬盘? I read the doc and I did not find any option like DropBox where save_url() can be used to remote upload. 我阅读了文档,但没有找到任何类似DropBox的选项,其中save_url()可用于远程上传。

But, there are a lot of sites which allows remote upload to Google Drive, so it must be possible. 但是,有很多站点允许远程上传到Google云端硬盘,因此必须可行。

You may refer with this tutorial on how to directly upload files from the web to Google Drive without saving them completely on the server before. 您可以参考本教程 ,了解如何直接从网络上载文件到Google云端硬盘,而无需将它们完全保存在服务器上。 This is useful to upload files, which are bigger than the storage available on the server. 这对于上载大于服务器上可用存储空间的文件很有用。

How to use it: 如何使用它:

  • Rename "credentials/oauth-credentials_EXAMPLE.json" to "credentials/oauth-credentials.json" "credentials/oauth-credentials_EXAMPLE.json"重命名为"credentials/oauth-credentials.json"
  • Download your oauth2 credentials in the google developer console and copy it in it 在Google Developer Console中下载您的oauth2凭据并将其复制到其中
  • Call the "index.php" from the console ( "php index.php" ) 从控制台调用"index.php""php index.php"
  • Follow the messages in the console window 遵循控制台窗口中的消息
  • Create pull requests to help with the development 创建请求请求以帮助开发

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM