I'm trying to send a file from my Flask app through
send_from_directory() without success.
The request returns a response with
status_code=200 but no file is being downloaded. I have verified the functions work as they return errors when the file or directory does not exist
This is the last line of my function. It handles
POST requests and should return a file after it has been saved.
# openpyxl stuff above wb.save(app.instance_path + '/path/to/file/spreadsheet.xlsx') return send_file(current_dir + '/path/to/file/spreadsheet.xlsx')
This is what is returned from the server
127.0.0.1 - - [21/Apr/2019 20:05:26] "POST /api/admin/export_bookings HTTP/1.1" 200 -
I verified that the file is indeed being created and saved, and I have verified that the above last line returns an error if the path is wrong or if the file doesn't exist.
Why is this happening?