title: Issue while requesting a file(image/pdf/excel sheet) from server and then pipe to res
body: <p><strong>Scenario:</strong></p>
  
  <p>I have to send user file which is stored remotely in a server(cloudinary) to browser. I'm able to request an image from server and then pipe it to browser but it's not working for other files like pdf, excel sheet, etc.</p>
  
  <pre><code>exports.fetchFile = function(req, res, next){
  var fileUrl = "/" + req.params.fileUrl;
  console.log(fileUrl);
  
  async.auto({
      'A': function(callback) {
          var queryObj = { 'myUrl' : fileUrl};
          // DB Query to retrieve user file information like url, type, etc.
          UserFileCtrl.fetchUserFile(queryObj, callback);
      }
  }, function(err, results){
      if(err) {
          return res.send(500, "error");
      }
  
      var secureUrl = results['A']['secureUrl'];
      var fileType = results['A']['fileType'];
      // this will be "application/pdf" for pdf
      res.setHeader('Content-Type', fileType);
  
      request(secureUrl).pipe(res);
  }); 
  }
  </code></pre>
  
  <p>Above code gives an empty pdf file to client whereas if I open directly the cloudinary url then it's coming properly. I'm breaking my head for a long time but not able to get something out of it.</p>
  
  <p>I really appreciate your help.</p>
  
  <p>Edit: I found this similar question also: <a href="https://stackoverflow.com/questions/28412919/express-server-send-empty-pdf-file">Express server send empty PDF file</a> but this is also not working for me. I tried disabling connnect-livereload but even then it's not working.</p>
  
  <p>The issue is happening only for pdfs. All other formats are working fine.</p>