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
Post a Comment