Created
March 3, 2016 07:44
-
-
Save codeorelse/dfd2c4851d43a2cb2dd4 to your computer and use it in GitHub Desktop.
Download image for Dynamic Video
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
function downloadAsset(assetUrl, renameTo, dataFolder)=> { | |
var defer = Promise.defer() | |
var download = new Download() | |
.get(assetUrl) | |
.rename(renameTo) | |
.dest(path.resolve(dataFolder) | |
download.run(function (err, files, stream) { | |
defer.resolve(); | |
}); | |
return defer.promise | |
} | |
// downloadAsset('http://yourdomain/image.jpg,'phone.png', 'folderYourTemplatesLives'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment