From aae1c8e6fb88ade8776e2f2c03f9ce4fbe407b40 Mon Sep 17 00:00:00 2001 From: aesyondu <57334943+aesyondu@users.noreply.github.com> Date: Mon, 10 May 2021 18:56:20 +0800 Subject: [PATCH] docs(readme): add instruction for shared folder https://github.com/gimite/google-drive-ruby/issues/360 --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 1104cb6a..3d6c2c04 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,18 @@ p ws.rows #==> [["fuga", ""], ["foo", "bar]] ws.reload ``` +### Example to upload to shared folder + +```ruby +config = "/path/to/config.json" +GoogleDrive::Session + .from_service_account_key(config) + .collection_by_url("https://drive.google.com/drive/folders/gF1dvxQfFeRcQgFOdgid0aAcM1q9i6K15") + .upload_from_file("/path/to/local/file.txt") +``` + +[If you want to share your files/documents/folders with the service account, share them with the client_email address in the JSON file.](https://github.com/gimite/google-drive-ruby/blob/master/doc/authorization.md#on-behalf-of-no-existing-users-service-account) + ## License