name = secure_filename(img['datafile'].filename)
with open(name, 'wb') as fileOutput:
    fileOutput.write(request.args['datafile'][0])
app.run('localhost', 8000)
How to receive uploaded file with Klein like Flask in python