Reputation: 363
I am using amazon sdk version 2
For presigned_url i use the below url = signer.presigned_url(:get_object, bucket: bucket, key: key)
But how do i set the filename?( For users when they select save as..)
Upvotes: 2
Views: 2421
Reputation: 363
Need to add response_content_disposition and set the filename
signer = Aws::S3::Presigner.new signer.presigned_url(:get_object, bucket: bucket, key: key, response_content_disposition: "attachment;filename=test.pdf")
Upvotes: 4
Reputation: 3110
If you add ${filename} to the key it will be replaced with the filename chosen when uploading the file.
Upvotes: 1