From 1bd19235e0dcfe058cc5e0bf3b5def43474f82ad Mon Sep 17 00:00:00 2001 From: mxr612 Date: Tue, 17 Jun 2025 16:10:19 +0800 Subject: [PATCH] feat: add Content-Disposition header for file downloads in download_scale_results - Enhanced the download_scale_results function to include a Content-Disposition header, specifying the filename for the "psychoscales.db" file download. This improves the user experience by prompting the correct file name during downloads. --- app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app.py b/app.py index a92e087..25d8042 100644 --- a/app.py +++ b/app.py @@ -273,6 +273,7 @@ async def download_scale_results(scale_id: str, db: Session = Depends(get_db)): return FileResponse( "psychoscales.db", headers={ + "Content-Disposition": f'attachment; filename="psychoscales.db"', "Cache-Control": "no-store, no-cache, must-revalidate, max-age=0", "Pragma": "no-cache", "Expires": "0"