Created
March 3, 2018 06:02
-
-
Save jeznag/a755f5e56d6ee6d84bf629f42d7c68a6 to your computer and use it in GitHub Desktop.
downloading PDF from zoho creator
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
const fileStream = fs.createWriteStream(fileName); | |
const requestOptions = { | |
url: URL, | |
headers: { | |
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36' | |
} | |
}; | |
request(requestOptions).pipe(fileStream); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment