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