Created
November 4, 2016 17:32
-
-
Save MaxySpark/c278e32275d07fba274fb37a3e363e48 to your computer and use it in GitHub Desktop.
Download File Using Nodejs
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
var http = require('http'); | |
var fs = require('fs'); | |
var file = fs.createWriteStream("file.jpg"); | |
var request = http.get("http://i3.ytimg.com/vi/J---aiyznGQ/mqdefault.jpg", function(response) { | |
response.pipe(file); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment