Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

download file axios nodejs

axios.get('https://xxx/my.pdf', {responseType: 'blob'}).then(response => {
    fs.writeFile('/temp/my.pdf', response.data, (err) => {
        if (err) throw err;
        console.log('The file has been saved!');
    });
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #download #file #axios #nodejs
ADD COMMENT
Topic
Name
3+6 =