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

service - Android MediaPlayer calls onCompletion before it already finished -

javascript - Training Neural Network to play flappy bird with genetic algorithm - Why can't it learn? -

javascript - Create a stacked percentage column -