Skip to content

Commit

Permalink
Maintain the original image file's content-type in the object store #29
Browse files Browse the repository at this point in the history
  • Loading branch information
joelvdavies committed Oct 4, 2024
1 parent d86cdb8 commit d266f76
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion object_storage_api/stores/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ def upload_image(self, image_id: str, image: ImagePostSchema) -> str:

logger.info("Uploading image file to the object storage")
s3_client.upload_fileobj(
image.upload_file.file, Bucket=object_storage_config.bucket_name.get_secret_value(), Key=object_key
image.upload_file.file,
Bucket=object_storage_config.bucket_name.get_secret_value(),
Key=object_key,
ExtraArgs={"ContentType": image.upload_file.content_type},
)

return object_key

0 comments on commit d266f76

Please sign in to comment.