浏览代码

Merge pull request #1076 from zauberzeug/media-files

Fix serving media files from subdirectories
Rodja Trappe 1 年之前
父节点
当前提交
484d957dd3
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      nicegui/app.py

+ 1 - 1
nicegui/app.py

@@ -126,7 +126,7 @@ class App(FastAPI):
         :param url_path: string that starts with a slash "/" and identifies the path at which the files should be served
         :param local_directory: local folder with files to serve as media content
         """
-        @self.get(url_path + '/{filename}')
+        @self.get(url_path + '/{filename:path}')
         async def read_item(request: Request, filename: str) -> StreamingResponse:
             filepath = Path(local_directory) / filename
             if not filepath.is_file():