title: why res.download is downloading an empty zip file?
body: <p>I am using expressjs to develop my app. I have written a service which downloads the file at client using <code>res.download(filepath, filename)</code>. Following is my service.</p>
  
  <pre><code>router.route('/downloadFile').get(function(req,res){
      var filter = url.parse(req.url, true).query.filter;
  
      Model.find({label:filter}).exec()
      .catch(function(err){
          console.error(err);
      })
      .then(function(data){
          var fileTobeDownloadedPath = foo(); //returns a zip file path which belongs to a location in my temp folder in project
  
          res.download(fileTobeDownloadedPath, path.parse(fileTobeDownloadedPath).base);
      });
  });
  </code></pre>
  
  <p>Here is my frontend javascript code</p>
  
  <pre><code>$(document).on('click','#btnDownload', function(event) {
    // I am populating the values of the array using some javascript query
    window.open('/downloadFile?filter=' + angular.element('[ng-controller=mainCtrl]').scope().mainCtrlObj.modalContent.label +
                '&amp;tags=' + angular.element('[ng-controller=mainCtrl]').scope().mainCtrlObj.modalContent.tags.toString() +
                '&amp;sizes=' + sizes.toString() + '&amp;formats=' + formats.toString());
  });
  </code></pre>
  
  <p>Depending upon the checkbox selected by the user on the frontend, service will either call res.download with zip file path as the argument or single file path. But when I select multiple options and click download I should have a zip file downloaded. </p>
  
  <p>File is currently getting downloaded but the zip file size is 0 byte and there is no file in the zip file.</p>
  
  <p>Please let me know what has gone wrong. Thanks in Advance. </p>