Skip to content

Commit e749a8f

Browse files
authored
chore: Fix Drive V3 sample in the readme (#5319)
1 parent 765e065 commit e749a8f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ files.items.each do |file|
3030
end
3131

3232
# Upload a file
33-
metadata = Google::Apis::DriveV3::File.new(title: 'My document')
34-
metadata = drive.insert_file(metadata, upload_source: 'test.txt', content_type: 'text/plain')
33+
metadata = Google::Apis::DriveV3::File.new(name: 'test.txt')
34+
metadata = drive.create_file(metadata, upload_source: '/tmp/test.txt', content_type: 'text/plain')
3535

3636
# Download a file
37-
drive.get_file(metadata.id, download_dest: '/tmp/myfile.txt')
37+
drive.get_file(metadata.id, download_dest: '/tmp/downloaded-test.txt')
3838
```
3939

4040
Following is another example using the Content API (Google Merchant Center), provided by the `google-apis-content_v2` gem:

0 commit comments

Comments
 (0)