From a7fd18b43cd56cb56a9b5cf0afae922d2d6b5f88 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 4 Aug 2026 16:09:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20filetype=20overflow=20for=20extensionles?= =?UTF-8?q?s=20files=20=E2=80=94=20os.path.splitext=20+=20[:10]=20cap=20pr?= =?UTF-8?q?events=20MySQL=20DataError=201406?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- filemgr/filemgr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filemgr/filemgr.py b/filemgr/filemgr.py index d1be906..0f8af66 100644 --- a/filemgr/filemgr.py +++ b/filemgr/filemgr.py @@ -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