-
-
Save ossistyle/02fb9e9e0fac786a143eb1cae2a932a0 to your computer and use it in GitHub Desktop.
Download image for Dynamic Video
This file contains hidden or 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