Skip to content

Instantly share code, notes, and snippets.

View dbismut's full-sized avatar
🏠
Working from home

David Bismut dbismut

🏠
Working from home
View GitHub Profile
@jhgaylor
jhgaylor / meteor_download.js
Last active January 18, 2018 10:31
Download files to the filesystem on the meteor server
//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