Hi John,
I needed to do the same and I managed to get it working by setting the
content disposition after the file is uploaded to S3.
Here is a snippet of my code:
# photo.rb
has_attached_file :data, ...
def set_attachment_content_disposition(style, file_name)
path = self.data.path(style)
bucket_name = self.data.bucket_name
obj = AWS::S3::S3Object.find(path, bucket_name)
obj.content_disposition = 'attachment; filename="' + file_name +
'"'
obj.store
end
The code above is using Paperclip 2.3.1 and AWS/S3 gem.
Cheers,
Kris
On Aug 26, 5:10 am, John Reilly <
john.j.rei...@gmail.com> wrote:
> On Aug 25, 1:05 pm, John Reilly <
john.j.rei...@gmail.com> wrote:
>
> > Does anyone have any suggestions on how to put the correct uploaded
> > file name into this header?
>
> One thing I've tried is to add paperclip interpolations into the
> values of the s3_headers hash. I think this would be a good solution
> to my problem.
>
> Here's a commit on my fork:
http://github.com/johnreilly/paperclip/commit/bfe12b8a48ebdbbb08cdc97...