fix(file_service): normalize file extension to lowercase

This commit is contained in:
-LAN- 2024-11-01 15:13:28 +08:00
parent 3823d959fd
commit 1d1e51a057

View File

@ -38,7 +38,7 @@ class FileService:
source_url: str = "", source_url: str = "",
) -> UploadFile: ) -> UploadFile:
# get file extension # get file extension
extension = filename.split(".")[-1] extension = filename.split(".")[-1].lower()
if len(filename) > 200: if len(filename) > 200:
filename = filename.split(".")[0][:200] + "." + extension filename = filename.split(".")[0][:200] + "." + extension