fix: filetype overflow for extensionless files — os.path.splitext + [:10] cap prevents MySQL DataError 1406

This commit is contained in:
yumoqing 2026-08-04 16:09:51 +08:00
parent 5a81ea2c00
commit a7fd18b43c

View File

@ -110,7 +110,7 @@ class FileMgr:
"name":os.path.basename(params_kw.upfile),
"webpath": webpath,
"realpath": realpath,
"filetype":params_kw.upfile.split('.')[-1].lower(),
"filetype":os.path.splitext(params_kw.upfile)[1].lstrip('.').lower()[:10],
"filesize":filesize,
"ownerid": u.userorgid,
"hashvalue": hashvalue