Enhancement: put_object
to infer ContentType
if not provided
#3904
Labels
feature-request
This issue requests a feature.
response-requested
Waiting on additional information or feedback.
s3
Describe the feature
When using the
put_object
method in boto3, if theContentType
is not specified, the object does not have aContentType
set. Many tools, including the AWS CLI, are capable of inferring theContentType
based on the file extension. It might be beneficial for boto3 to have a similar capability, especially for commonly used file types.Use Case
When doing something like the following:
One might expect the uploaded file to have a
ContentType
oftext/html
if it hasn't been explicitly set.Proposed Solution
Enhance the
put_object
method to infer theContentType
based on the file extension if it's not provided. This behavior could be opt-in to preserve backward compatibility.Other Information
No response
Acknowledgements
SDK version used
1.28.62
Environment details (OS name and version, etc.)
macOS Sonoma 14.0 (23A344), Python 3.11.5
The text was updated successfully, but these errors were encountered: