From ac1c381761f1978eb56a59ed96d1c2d83d43314a Mon Sep 17 00:00:00 2001 From: George Date: Fri, 20 Apr 2018 19:32:59 -0400 Subject: [PATCH] Make sample object explicitly public-read --- s3_sample.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/s3_sample.rb b/s3_sample.rb index 085e3f7..6220396 100755 --- a/s3_sample.rb +++ b/s3_sample.rb @@ -47,8 +47,11 @@ # # For more information on Aws::S3::Object#put, see: # http://docs.aws.amazon.com/sdkforruby/api/Aws/S3/Object.html#put-instance_method -object = bucket.object('ruby_sample_key.txt') -object.put(body: "Hello World!") +object = bucket.put_object({ + acl: "public-read", + body: "Hello World!", + key: "ruby_sample_key.txt" # required +}) # Aws::S3::Object#public_url generates an un-authenticated URL for the object. #