When using s3cmd sync, and I'm syncing .css files, they are getting created with content-type of "text/plain" instead of "text/css".
This may be the case because the CSS files contain long lines, but I'm not sure.
That's because your system mime config doesn't know about css files. S3cmd relies on that to identify the mime type, by itself it doesn't make any decisions about file types.
file -i style.css
I know I can override the mime-type for individual files with the --mime-type=MIME/TYPE option, but I am currently doing a sync that could include many files (some CSS, some JS, some images, etc.).
So, is there a way for s3cmd to use the file extension to determine the mime-type, instead of the magic method?
I have the same issue and it's a real pain. It makes sync unusable for updating web sites, at least on Linux.
Traditionally file name suffixes are ignored on Unix systems (by http://wiki.debian.org/MIME) so just relying on magic numbers mechanism gives inconsistent results for text-based file types.
I really hope there's a way to make this work in s3cmd.
This issue is also tracked at https://github.com/s3tools/s3cmd/issues/198
I created a patch and pull request.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.