carrierwaveuploader / carrierwave

Classier solution for file uploads for Rails, Sinatra and other Ruby web frameworks
https://github.com/carrierwaveuploader/carrierwave
8.78k stars 1.66k forks source link

Copying does not apply S3 acl #2627

Closed xanderman closed 1 year ago

xanderman commented 2 years ago

This is possibly related to #2240. I'm not sure if they're the same issue or not.

We have the following in our carrierwave initializer:

config.fog_attributes = {
  "Content-Disposition" => "attachment;",
  cache_control: "max-age=315576000",
  expires: 1.year.from_now.httpdate,
  'x-amz-acl' => 'bucket-owner-full-control'
}

The acl is properly set on uploads, but is lost on copies. We use code like record.document.file.copy_to(new_path) to do an S3 copy, where document is a column with an uploader mounted. The new S3 object is created with a private acl, when it should have the bucket-owner-full-control acl.

mshibuya commented 1 year ago

Fixed by #2503.