def METHOD_NAME(tier_id, location_ids, season_ids, filename):
    """Download zipped ILINet data for the given locations and seasons."""
    def get_entry(num, name=None):
        return {"ID": num, "Name": (name if name else num)}
    # download the data (in memory)
    url = "https://gis.cdc.gov/grasp/flu2/PostPhase02DataDownload"
    data = {
        "AppVersion": "Public",
        "DatasourceDT": [get_entry(1, "ILINet"), get_entry(0, "WHO_NREVSS")],
        "RegionTypeId": tier_id,
        "SubRegionsDT": [get_entry(loc) for loc in sorted(location_ids)],
        "SeasonsDT": [get_entry(season) for season in sorted(season_ids)],
    }
    resp = requests.post(url, json=data)
    check_status(resp, 200, "application/octet-stream")
    payload = resp.content
    # save the data to file and return the file length
    with open(filename, "wb") as f:
        f.write(payload)
    return len(payload)