Added support to download and write files to local file system