diff --git a/s3fs/core.py b/s3fs/core.py index 11053005..b4ab8a93 100644 --- a/s3fs/core.py +++ b/s3fs/core.py @@ -1153,7 +1153,7 @@ async def _put_file( callback.set_size(size) if "ContentType" not in kwargs: - content_type, _ = mimetypes.guess_type(lpath) + content_type = mimetypes.guess_type(rpath)[0] or mimetypes.guess_type(lpath)[0] if content_type is not None: kwargs["ContentType"] = content_type