From 5a552f02eaa1510d697645dec521880aa9bef1df Mon Sep 17 00:00:00 2001 From: han0 Date: Wed, 22 Mar 2023 10:15:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E8=8E=B7=E5=8F=96=E6=96=87=E4=BB=B6=E5=90=8E?= =?UTF-8?q?=E7=BC=80=E5=90=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nc_http/core/file/func.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nc_http/core/file/func.py b/nc_http/core/file/func.py index 1246a26..86790cf 100644 --- a/nc_http/core/file/func.py +++ b/nc_http/core/file/func.py @@ -22,7 +22,7 @@ def save_file(f: FileStorage, path: str, namespace: str = None, filename: str = if not os.path.exists(save_path): os.makedirs(save_path) - filename = filename or '{}{}'.format(str(int(time.time() * 1000)), os.path.splitext(f.name)[-1]) + filename = filename or '{}{}'.format(str(int(time.time() * 1000)), os.path.splitext(f.filename)[-1]) file_path = os.path.join(save_path, filename) with open(file_path, 'wb+') as tmp_f: tmp_f.write(f.read())