def make_file_path(url, ext):
    """
    Makes a valid Windows file path for a given url.
    """
    url = url.replace(ext, '')
    for char in '/\\ *':
        url = url.replace(char, '-')
    for char in '|:?&<>':
        url = url.replace(char, '')
    url = url[:255] + ext
    return url
