def transform():
    data = inbound_file.read()
data = data.replace('A', 'Z')
response = make_response(data)
response.headers['Content-Disposition'] = 'attachment; filename=outbound.txt'
return response
Download file, parse it and serve in Flask