Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/59.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 如何使用与rails集成的Refile gem设置S3 ACL参数?_Ruby On Rails_Ruby_Amazon S3_Sendgrid_Refile - Fatal编程技术网

Ruby on rails 如何使用与rails集成的Refile gem设置S3 ACL参数?

Ruby on rails 如何使用与rails集成的Refile gem设置S3 ACL参数?,ruby-on-rails,ruby,amazon-s3,sendgrid,refile,Ruby On Rails,Ruby,Amazon S3,Sendgrid,Refile,我正在使用RefileGem在带有Rails 4的S3上上传图像。使用我当前的设置,我只能在手动更新ACL后通过S3URL查看图像 有没有办法将Refile gem配置为将ACL参数设置为public_read?我现在可以通过将S3 bucket策略更新为以下内容来访问图像: { "Version": "2008-10-17", "Statement": [ { "Sid": "AllowPublicRead", "

我正在使用RefileGem在带有Rails 4的S3上上传图像。使用我当前的设置,我只能在手动更新ACL后通过S3URL查看图像


有没有办法将Refile gem配置为将ACL参数设置为public_read?

我现在可以通过将S3 bucket策略更新为以下内容来访问图像:

{
    "Version": "2008-10-17",
    "Statement": [
        {
            "Sid": "AllowPublicRead",
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            },
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::MY_BUCKET_NAME/*"
        }
    ]
}