'Uses the filename to see if the file can be shown in HTML or not.'

def _is_binary(self, mimetype, path):

    ext = os.path.splitext(path)[1][1:]
    if (ext in blocked_extensions):
        return True
    if (private_storage.exists(path) and (not os.path.isdir(path))):
        with private_storage.open(path, 'r') as rfile:
            bytes = tuple(map(ord, rfile.read(4)))
        if any(((bytes[:len(x)] == x) for x in blocked_magic_numbers)):
            return True
    if mimetype:
        (major, minor) = mimetype.split('/')
        if (major == 'image'):
            return 'image'
    return False
