Added support for downloading to directory path.