title: How to send a pdf file from Node/Express app to the browser
body: <p>In my Node/Express app I have the following code, which suppose to read a PDF document from a file, and send it to the browser:</p>
  
  <pre><code>var file = fs.createReadStream('./public/modules/datacollectors/output.pdf', 'binary');
  var stat = fs.statSync('./public/modules/datacollectors/output.pdf');
  res.setHeader('Content-Length', stat.size);
  res.setHeader('Content-Type', 'application/pdf');
  res.setHeader('Content-Disposition', 'attachment; filename=quote.pdf');
  res.pipe(file, 'binary');
  res.end(); 
  </code></pre>
  
  <p>I do not get any errors, but I do not get the file in my browser either.
  What am I doing wrong?</p>