My current flow is that the user posts a form, I fetch a DataFrame using their input, and I try to start a download for a csv containing the DataFrame's data.
Current code:
return Response(
df.to_csv(),
mimetype="text/csv",
headers={"Content-disposition": "attachment; filename=output.csv",
'Content-Type': 'application/octet-stream'})
This correctly starts a download for smaller amounts of data, but if I across some unknown size threshold, no download starts. I am printing the head of the DataFrame each time, so I know that operation is working.
My guess is that it is somehow timing out, or not accepting the Response because of the file size.
I added the octet stream header from another similar thread.
Edit: it may have been Chrome's automatic download blocking. Not sure how to get around that, i.e. make a regular download that Chrome doesn't find suspicious.