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())