Created
October 22, 2021 15:26
-
-
Save polluterofminds/396cf78fd06863b02f8ee527bc6f16fa to your computer and use it in GitHub Desktop.
Download File From Gateway And Write to Local Disk
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
const http = require('https'); | |
const fs = require('fs'); | |
const file = fs.createWriteStream("FILE_NAME"); | |
const request = http.get("GATEWAY_URL_FOR_FILE_IN_DIRECTORY", function(response) { | |
response.pipe(file); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment