def filename_from_disposition(content_disposition):
    """
    Gets a filename from the given content disposition header.
    """
    filename_pos = content_disposition.index('filename=')

    if filename_pos == -1:
        raise Exception('"filename=" not found in content disposition file')

    return content_disposition[filename_pos + len('filename='):]