Open Nitemaeric opened 8 years ago
Could you create a PR with a fix?
I ran into this problem as well. My workaround is using the string public-read
instead of the symbol :public_read
Example:
object = bucket.objects.find("lenna.png")
object.copy(:key => "lenna.png", :bucket => bucket, :acl => 'public-read')
So, after much confusion, seems that there is a bug with the "copy_object" method.
The documentation states that you can do:
But after digging around I found that the
:acl => :public_read
causes anInvalidArgument
Error.https://github.com/qoobaa/s3/blob/master/lib/s3/object.rb#L40 parses the
acl
attribute on the object for normal "saving", but for the copy method, https://github.com/qoobaa/s3/blob/master/lib/s3/object.rb#L159, this parsing is skipped, sending "publicread" to S3, which it doesn't allow. i.e. "" instead of "-".