When downloading files, move fs.readFile into the callback after it finishes writing.