問題描述
我需要從一些 linux 服務器將各種文件類型備份到 GDrive(不僅僅是那些可轉換為 GDocs 格式的文件).
I need to backup various file types to GDrive (not just those convertible to GDocs formats) from some linux server.
使用 python 腳本最簡單、最優雅的方法是什么?與 GDocs 有關的任何解決方案都適用嗎?
What would be the simplest, most elegant way to do that with a python script? Would any of the solutions pertaining to GDocs be applicable?
推薦答案
您可以使用 Documents List API 編寫寫入 Drive 的腳本:
You can use the Documents List API to write a script that writes to Drive:
https://developers.google.com/google-apps/documents-list/
Documents List API 和 Drive API 都與相同的資源(即相同的文檔和文件)交互.
Both the Documents List API and the Drive API interact with the same resources (i.e. same documents and files).
Python 客戶端庫中的此示例顯示了如何將未轉換的文件上傳到云端硬盤:
This sample in the Python client library shows how to upload an unconverted file to Drive:
http://code.google.com/p/gdata-python-client/source/browse/samples/docs/docs_v3_example.py#180
這篇關于如何使用 Python 腳本將文件上傳到 Google Drive?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!