This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//given the urls of files to download, store them on the filesystem | |
function download_all_files (urls, base_destination, job_id, cb) { | |
var url = urls.shift(); | |
var file_path = path.join(base_destination, job_id); | |
// the path to the file without the filename | |
var path_to_file_folder = path.dirname(file_path); | |
// the method to store a downloaded file to the fs | |
// makes an http request and writes the response to a file |