Skip to content

Commit

Permalink
API file download
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislavsulc committed Feb 5, 2024
1 parent 3b70ae7 commit cbd5bd8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mupifDB/api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def get_executions(status: str = "", workflow_version: int = 0, workflow_id: str
filtering["label"] = label
if num_limit == 0:
num_limit = 999999
res = db.WorkflowExecutions.find(filtering).limit(num_limit) # .sort('CreatedDate', 1)
res = db.WorkflowExecutions.find(filtering).sort('SubmittedDate', 1).limit(num_limit)
if res:
for s in res:
output.append(table_structures.extendRecord(fix_id(s), table_structures.tableExecution))
Expand Down Expand Up @@ -472,7 +472,7 @@ def get_file(uid: str, tdir=Depends(get_temp_dir)):
with open(fullpath, "wb") as f:
f.write(wfile.read())
f.close()
return FileResponse(path=fullpath, headers={"Content-Disposition": "attachment; filename=" + fn})
return FileResponse(path=fullpath, media_type='application/octet-stream', headers={"Content-Disposition": "attachment; filename=" + fn})


@app.post("/file/", tags=["Files"])
Expand Down

0 comments on commit cbd5bd8

Please sign in to comment.