def get_inputfile_as_string(request):
    """Returns the input file from the POST request as a string,
    no matter if it was sent as a file named 'input' or a form field
    named 'input'.

    Returns None if the POST request does not have an 'input' file.
    """
    if 'input' in request.files:
        input_bytes = request.files['input'].read()
        return str(input_bytes, 'utf-8')
    elif 'input' in request.form:
        return request.form['input']