const zip = {
method: 'GET',
url: distURL + "/zips/" highestNumber + ".zip",
responseType: 'arraybuffer'
}
axios(zip).then(response => {
console.log("Downloading ZIP: " + highestNumber )
fs.writeFileSync("./zips/" + highestNumber + ".zip", Buffer.from(response.data));
})
I have this script above, it downloads a ZIP file from a server and there are ZIP files named as 0.zip
, 22.zip
, 15.zip
and on...
I wonder how can I download the highest available (200) ZIP file and save it?
I have been trying to figure this out for hours but I'm straight stuck.