Quote:http.get(options, function(res) { res.on('data', function(data) { file.write(data); }).on('end', function() { file.end(); console.log(file_name + ' downloaded to ' + DOWNLOAD_DIR); }); });
From: <a href="https://www.hacksparrow.com/nodejs/using-node-js-to-download-files.html">Using Node.js to download files</a>[<a href="https://www.hacksparrow.com/nodejs/using-node-js-to-download-files.html" target="_blank" title="New Window">^</a>]
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)