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),
|
"name":os.path.basename(params_kw.upfile),
|
||||||
"webpath": webpath,
|
"webpath": webpath,
|
||||||
"realpath": realpath,
|
"realpath": realpath,
|
||||||
"filetype":params_kw.upfile.split('.')[-1].lower(),
|
"filetype":os.path.splitext(params_kw.upfile)[1].lstrip('.').lower()[:10],
|
||||||
"filesize":filesize,
|
"filesize":filesize,
|
||||||
"ownerid": u.userorgid,
|
"ownerid": u.userorgid,
|
||||||
"hashvalue": hashvalue
|
"hashvalue": hashvalue
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user