diff --git a/app/methods/hosted_file_methods.py b/app/methods/hosted_file_methods.py index e5c4031..32c712b 100644 --- a/app/methods/hosted_file_methods.py +++ b/app/methods/hosted_file_methods.py @@ -1,4 +1,4 @@ -import datetime, hashlib, os, pathlib, shutil, time +import datetime, hashlib, mimetypes, os, pathlib, shutil, time from fastapi import File, UploadFile from typing import Dict, List, Optional, Set, Union @@ -441,8 +441,7 @@ async def save_file_to_hosted_file( # There is a difference between Content-Type and MIME type. # https://stackoverflow.com/questions/3452381/whats-the-difference-of-contenttype-and-mimetype - # file_info['content_type'] = file.content_type # might also include charset or other parameters - # file_info['mimetype'] = file.mimetype # This may need to be filled in a different way? + file_info['content_type'] = mimetypes.guess_type(filename)[0] file_obj.seek(0, os.SEEK_END) file_size = file_obj.tell()