fix: filetype overflow for extensionless files — os.path.splitext + [:10] cap prevents MySQL DataError 1406
This commit is contained in:
parent
5a81ea2c00
commit
a7fd18b43c
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user