Adding os.path.abspath
to the send_file
request fixes the issue for me by making the send_file
request pull from the first folder location described in my question.
The second endpoint becomes:
@app.route('/get/<string:name>', methods=['GET'])
def get(name: str):
saved_file: SavedFile = SavedFile.query.filter_by(filename=name).first()
path = os.path.join(current_app.config['UPLOAD_FOLDER'], saved_file.filename)
return send_file(os.path.abspath(path), as_attachment=True)