From 1ee244ee391ff7e6c40721c66cd2fe9c00d1e3d4 Mon Sep 17 00:00:00 2001 From: "Gan, Jimmy" Date: Fri, 17 Apr 2026 14:17:33 +0800 Subject: [PATCH] fix: set filename in file download response --- dashboard/backend/routers/files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/backend/routers/files.py b/dashboard/backend/routers/files.py index 24dac13..3f58f87 100644 --- a/dashboard/backend/routers/files.py +++ b/dashboard/backend/routers/files.py @@ -94,7 +94,7 @@ def download(path: str): target = _safe_path(path) if not target.exists(): raise HTTPException(status_code=404, detail="File not found") - return FileResponse(target) + return FileResponse(target, filename=target.name) except ValueError: raise HTTPException(status_code=403, detail="Access denied")