How to get the text from file to save? Using Requests and Flask - don't want to go down the file upload function.
View:
@app.route('/postit2', methods=['GET', 'POST'])
def postit2():
x = request.files.getlist('textfile')
#gives empty dict: x = request.files.getlist('textfile')
with open('/home/MadMartin/datapostfiles/EFL9.txt', 'w') as f:
f.write(str(x))
return '''ok'''