def METHOD_NAME(filedata, charid):
    """
    Creates a preview-size copy of an uploaded image file for a new thumbnail
    selection file.
    """
    filename = d.url_make(charid, "char/.thumb", root=True)
    files.write(filename, filedata)
    if image.check_type(filename):
        image.make_cover(filename)
    else:
        os.remove(filename)
        raise WeasylError("FileType")