How to set default Content-Disposition headers on an Amazon S3 bucket

The problem is that I need the Content-Disposition: attachment header, which will be present in EVERY file that gets into my bucket.

In Wordpress, I can simply use .htaccess to cover the file types (video) in question, but these rules do not apply to my S3 downloads, which browsers just try to open, not load.

I need an automatic / standard solution, since I'm not the only one who downloads these files (our employees download via Wordpress, and all downloads are stored in our S3 bucket). Therefore, the use of Cloudberry or other browsers is not useful for this situation. I cannot configure files for each file (files are downloaded too often).

Is there any way to do this?

(Additional Information: I am using the Amazon S3 and Cloudfront plugin on Wordpress, which is responsible for combining the two together. Unfortunately, the site is not public, so I can not link to it.)

+4
source share
2 answers

Unfortunately, there is no way to set this for the entire bucket in S3, and Cloudfront can only install Cache-Headers

But you can set the Content-disposition parameter when uploading files to S3.

For existing files, you must change the title, so skip each object in the Bucket and copy it to yourself using the new headers .

, , , S3.

+7

All Articles