amazon-s3amazon-cloudfronts3cmd

s3cmd to set correct content type for image/jpeg


I have uploaded a number of directories that contain images, what is the correct way to modify the content-type to "image/jpeg" without having to re-upload the images?

I tried:

s3cmd modify s3://ccc-public/catalog/cropped/EP01L.jpg --add-header="Cache-Control:max-age=1296000" --mime-type="image/jpeg" --recursive -vvv

but the Content-Type always comes as binary/octet-stream

any advise much appreciated


Solution

  • s3cmd has recently (as in, this past weekend) fixed this, but the code is not yet upstream. Please try with this branch:

    https://github.com/mdomsch/s3cmd/tree/bug/content-type

    With a little more testing, this will get merged into upstream.

    Then, your command should work exactly as you expect. -mdomsch, s3cmd maintainer