Skip to content

automatically set Content-Type based on file type on S3 object upload #18

@jamesabel

Description

@jamesabel

Currently when a file is uploaded to an S3 bucket, the "Content-Type" is “binary/octet-stream”.

For some file types this is not ideal. For example, for a PDF to be viewed in the browser (as opposed to being downloaded), the "Content-Type" must be set to "application/pdf”.

The enhancement is:
For known file types (e.g., based on their filename extension), set the "Content-Type" to an appropriate value for that file type.

See the "ExtraArgs" parameter in boto3 upload on how to set "Content-Type".

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions