chore: save uploaded file extension as lower case (#10111)

This commit is contained in:
非法操作 2024-10-31 15:16:25 +08:00 committed by GitHub
parent 8b9fed75f3
commit e36f5cb366
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,7 +35,7 @@ class FileService:
filename = file.filename filename = file.filename
if not filename: if not filename:
raise FileNotExistsError raise FileNotExistsError
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