aws-sdk for Ruby access folder within bucket

后端 未结 5 1112
[愿得一人]
[愿得一人] 2020-12-25 08:09

I have a bucket on the Amazon S3 with the folder in it. I\'m trying to access it the following way via aws-sdk gem:

s3 = AWS::S3.new(
    :         


        
5条回答
  •  误落风尘
    2020-12-25 08:59

    has_attached_file :photo,
      storage: :s3,
      styles: { medium: "300x300>", thumb: "100x100>" },
      s3_credentials: "#{Rails.root}/config/aws.yml",
      bucket: "bucket-name",
      s3_host_name: "s3-ap-southeast-1.amazonaws.com",
      url: ":s3_domain_url",
      path: 'books/:id/photo/:style_:basename.:extension'
    

    worked for me :)

提交回复
热议问题