node.js - Files downloaded in electron with node's request library are corrupted -


i trying download png , word files on webserver using node's request library in electron. files generate code corrupted. below code

 var req =new request({     method: 'get',     uri: file_url,      headers:{        "content-type": "application/octet-stream",        "content-disposition": "attachment"      } }).pipe(fs.createwritestream(path.resolve()+"\\test.png",{defaultencoding: 'binary'})); 

i tried , without headers , encoding options. result still same. there other way


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -