I am using presigned urls for users to download their files from S3 and they were always opened by default by their browser and I want to override the behavior.
According to the documents, the only parameters they accept are :expires, :virtual_host, and :secure.
However, after mucking around I realised you could set the header in the method which wasn't mentioned in the docs, like so:
client = Aws::S3::Client.new(credentials: Aws::Credentials.new(access_key, secret)) signer = Aws::S3::Presigner.new(client: client) signer.presigned_url(:get_object, bucket: bucket, key: key, response_content_disposition: 'attachment')
No need for hacks to create a custom method for it!