I want to send file from node.js server to client on Angular. I'm using fileSaver.js on client.
Server:
res.download('123.txt', function(err){
if(err){
console.log('error');
}
})
Cliet:
$http.post('/downloadFile').success(function(res){
var file = new Blob([res]);
saveAs(file, '123.txt');
}
But it works only with .txt files. How to do this with other formats?