title: PDF File downloads incorrectly(corrupted ) in browser using express.js
body: <p>i am using following code snippet to download pdf and other types of file.</p>
  
  <pre><code>exports.getFile = function(req , res , next){
    var file = req.params.file
      , path = 'login/files/'+file;
    res.download(path);
  };
  </code></pre>
  
  <p>text file is downloaded correctly but pdf is not downloading correctly(it download but corrupted pdf file).i have seen pdf file is uploaded correctly to server(it is not corrupted on server.but downloading does it corrupt). i am unable to figure out this problem. please suggest me how to figure out this problem? Thanks in advance.</p>