Skip to content

Commit

Permalink
Update s3.py
Browse files Browse the repository at this point in the history
image downloading instead of displaying in browser or return in API, so we had an error "FileNotFoundError". That`s a problem in a ContentType
  • Loading branch information
KittNeKit authored Jan 4, 2024
1 parent 9cfe9d4 commit 3cc6d78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fastapi_storages/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def write(self, file: BinaryIO, name: str) -> str:
file.seek(0, 0)
key = self.get_name(name)

self._bucket.upload_fileobj(file, key, ExtraArgs={"ACL": self.AWS_DEFAULT_ACL})
self._bucket.upload_fileobj(file, key, ExtraArgs={"ACL": self.AWS_DEFAULT_ACL, "ContentType": "image/png"})
return key

def generate_new_filename(self, filename: str) -> str:
Expand Down

0 comments on commit 3cc6d78

Please sign in to comment.