This commit is contained in:
yumoqing 2024-12-20 17:04:48 +08:00
parent 11d7e3b82b
commit 6eed0f2f18

View File

@ -1,13 +1,14 @@
import os
import asyncio
import aiofiles
import mimetypes
from aiohttp.web_exceptions import HTTPNotFound
from aiohttp.web import StreamResponse
from aiohttp import web
import aiofiles
from appPublic.rc4 import RC4
from appPublic.registerfunction import RegisterFunction
from .filestorage import FileStorage
crypto_aim = 'God bless USA and others'
def path_encode(path):
@ -52,3 +53,14 @@ async def file_download(request, filepath, content_type=None):
await response.write_eof()
return response
raise HTTPNotFound
async def path_download(request, kw, *params):
path = kw.get('path')
fs = FileStorage()
fp = fs.realPath(path)
return await file_download(request, fp)
rf = RegisterFunction('download_path', path_download)