From de296765db0f4b4e85d9792ac33056affaefe469 Mon Sep 17 00:00:00 2001 From: vedina Date: Thu, 10 Aug 2023 21:08:14 +0300 Subject: [PATCH] content-disposition header --- app/api/upload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/upload.py b/app/api/upload.py index 712462d..a8cd256 100644 --- a/app/api/upload.py +++ b/app/api/upload.py @@ -65,6 +65,6 @@ async def get_dataset(request : Request, uuid: str,format:str = Query(None, desc file_path = os.path.join(UPLOAD_DIR, f"{uuid}.{format}") if os.path.exists(file_path): # Return the file using FileResponse - return FileResponse(file_path, media_type=format_supported[format]) + return FileResponse(file_path, media_type=format_supported[format], headers={"Content-Disposition": f'attachment; filename="{uuid}.{format}"'}) else: raise HTTPException(status_code=404, detail="Not found") \ No newline at end of file