Change content-type in S3 bucket policy for a specific file extension

Question:

Currently when I place a property list file (plist extension) to a S3 bucket, it sets the Content-type to application/octet-stream for some reason. It causes issues when I download it in Objective-C (iOS).

How can change the bucket policy so it automatically sets the Content-type to text/plain

Answer:

You cannot. The default content-type is “application/octet-stream”.

Please find below the aws documentation for the same
http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUT.html

The only option you have is setting the content-type at the time of upload or updating it once the upload is complete.

Leave a Reply