4

This is the URL generated by the Ruby aws-sdk gem for put:

curl --upload-file "/Users/README.rdoc" 
-H "x-amz-acl=public-read" 
"http://videos.s3.amazonaws.com/6c06517c-64f1-45ed-b07f-8c4c4edec6e3?AWSAccessKeyId={key}&Expires=1384519899&Signature=MKtBESBklYXFT%2B48EKLSoBiQpNA%3D"

-H "x-amz-acl=public-read" is not present in the signature. The signature is OK (Amazon doesn't show any errors).

But the "public-read" permission is not applied, please advise me as to how I can generate a put signed URL which will be public-read after upload.

Thanks!

Updated:

s3 = AWS::S3.new
bucket = s3.buckets['some_videos']
id = SecureRandom.uuid
object = bucket.objects["#{id}"]
url = object.url_for(:put, expires_in: 30*60)
2
  • Could you please add the Ruby code that you're using that generates this URL? Commented Nov 17, 2013 at 15:08
  • @carols10cents done, please look Commented Nov 17, 2013 at 15:11

2 Answers 2

3
+100

it looks like you can specify this with the acl method (documented here) If you want to set your bucket to public read you can call:

s3.buckets['some-videos'].acl = :public_read

if you would like to apply this permission directly to an object you can call:

bucket.objects["#{id}"].acl= :public_read
Sign up to request clarification or add additional context in comments.

1 Comment

Neal, it looks like SDK v2 takes a string "public-read" obj.upload_file(fd, { :acl => "public-read" })
3

Amazon team added this to their sdk. Thanks, guys! https://github.com/aws/aws-sdk-ruby/issues/412 https://github.com/aws/aws-sdk-ruby/commit/15e900c0918a67e20bbb6dd9509c112aa01a95ee

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.