Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- request(options, function (error, response, body) {
- if (error) throw new Error(error);
- fs.writeFile('./file1.pdf', body, 'binary', function (err) {
- if (err) throw err;
- console.log('Saved!');
- });
- console.log(body);
- }).pipe(fs.createWriteStream('./file2.pdf'));
Add Comment
Please, Sign In to add comment