In my application, I am using S3 to store files. But when retrieving those files, they are opening in new tab. But, I want to download those files. Following some references and AWS documentation, I came to know that we can achieve that using ContentDisposition
metadata parameter. I did as following:
s3.copyObject({
CopySource: object.bucket + '/' + object.key,
Bucket: BUCKET,
Key: object.destKey,
ContentDisposition: 'attachment; filename=some_file_name.jpg'
})
When I do as above, the ContentDisposition
metadata parameter is not being added (I checked in AWS S3 console). I am not sure where I am doing wrong. Please help me solve this.
Thanks...