Skip to content

Commit

Permalink
content-disposition header
Browse files Browse the repository at this point in the history
  • Loading branch information
vedina committed Aug 10, 2023
1 parent 3aaae06 commit de29676
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/api/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit de29676

Please sign in to comment.