-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S3Path does not set object mime-type when uploading a file on S3 #222
Comments
I agree it would be good to support content types—especially for web publishing flows. Maybe we can use an implementation like the above and have a Two notes:
|
An alternate solution could be to set globally a mime type / content encoding function provider. So the default implementation could be mimetypes.guess_type and it would be easy to provide an alternate implementation if needed. |
Agreed this should not need to be set per You can see examples of those two patterns in the docs here: Either way, though, you'd only have to set it in one place. |
@davidatsamp this should be fixed in |
I have tested it and integrate it. Thanks a lot 👍 |
In order to serve correctly S3 object from cloudfront origin, we need to set correctly S3 object mime-type.
Unfortunately the S3 client does not provide any mime-type when calling upload_file.
It could be possible to use at least the mimetypes module for the most common mime-types based on file extension in s3client.py:
The text was updated successfully, but these errors were encountered: