This commit is contained in:
yumoqing 2023-11-16 16:20:21 +08:00
parent 578cc3be08
commit 6b766496f1
2 changed files with 7 additions and 1 deletions

View File

@ -113,3 +113,8 @@ class FileStorage:
# print(f'{name=} file({fpath}) write {siz} bytes') # print(f'{name=} file({fpath}) write {siz} bytes')
self.tfr.newtmpfile(fpath) self.tfr.newtmpfile(fpath)
return fpath return fpath
def file_realpath(path):
fs = FileStorage()
return fs.realPath(path)

View File

@ -47,7 +47,7 @@ from .functionProcessor import FunctionProcessor
from .proxyProcessor import ProxyProcessor from .proxyProcessor import ProxyProcessor
from .serverenv import ServerEnv from .serverenv import ServerEnv
from .url2file import Url2File from .url2file import Url2File
from .filestorage import FileStorage from .filestorage import FileStorage, file_realpath
from .restful import DBCrud from .restful import DBCrud
from .dbadmin import DBAdmin from .dbadmin import DBAdmin
from .filedownload import file_download, path_decode from .filedownload import file_download, path_decode
@ -229,6 +229,7 @@ class ProcessorResource(AppLogger, StaticResource,Url2File):
return await auth.get_auth(request) return await auth.get_auth(request)
self.y_env.i18n = serveri18n self.y_env.i18n = serveri18n
self.y_env.file_realpath = file_realpath
self.y_env.redirect = redirect self.y_env.redirect = redirect
self.y_env.info = self.info self.y_env.info = self.info
self.y_env.error = self.error self.y_env.error = self.error