From 6b766496f1c93e88706ff06a132746dc624b42a4 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 16 Nov 2023 16:20:21 +0800 Subject: [PATCH] bugfix --- ahserver/filestorage.py | 5 +++++ ahserver/processorResource.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ahserver/filestorage.py b/ahserver/filestorage.py index 92e8494..ca1a4c5 100755 --- a/ahserver/filestorage.py +++ b/ahserver/filestorage.py @@ -113,3 +113,8 @@ class FileStorage: # print(f'{name=} file({fpath}) write {siz} bytes') self.tfr.newtmpfile(fpath) return fpath + +def file_realpath(path): + fs = FileStorage() + return fs.realPath(path) + diff --git a/ahserver/processorResource.py b/ahserver/processorResource.py index 52eb6bd..72115ea 100755 --- a/ahserver/processorResource.py +++ b/ahserver/processorResource.py @@ -47,7 +47,7 @@ from .functionProcessor import FunctionProcessor from .proxyProcessor import ProxyProcessor from .serverenv import ServerEnv from .url2file import Url2File -from .filestorage import FileStorage +from .filestorage import FileStorage, file_realpath from .restful import DBCrud from .dbadmin import DBAdmin from .filedownload import file_download, path_decode @@ -229,6 +229,7 @@ class ProcessorResource(AppLogger, StaticResource,Url2File): return await auth.get_auth(request) self.y_env.i18n = serveri18n + self.y_env.file_realpath = file_realpath self.y_env.redirect = redirect self.y_env.info = self.info self.y_env.error = self.error