Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1ee244ee39 | |||
| a807ec00af |
@@ -94,7 +94,7 @@ def download(path: str):
|
|||||||
target = _safe_path(path)
|
target = _safe_path(path)
|
||||||
if not target.exists():
|
if not target.exists():
|
||||||
raise HTTPException(status_code=404, detail="File not found")
|
raise HTTPException(status_code=404, detail="File not found")
|
||||||
return FileResponse(target)
|
return FileResponse(target, filename=target.name)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise HTTPException(status_code=403, detail="Access denied")
|
raise HTTPException(status_code=403, detail="Access denied")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user