title: How to download a file in the browser directly from the node.js server side without any variable?
body: <p>My app is created with <a href="http://meanjs.org" rel="nofollow noreferrer">mean</a> and I am a user of docker too. The purpose of my app is to create and download a CSV file. I already created my file, compressed it and placed it in a temp folder (the file will be removed after the download). This part is in the nodejs server side and works without problems. </p>
  
  <p>I already use several things like (res.download) which is supposed to download directly the file in the browser but nothing append. I tried to use blob in the angularjs part but it doesn't work.</p>
  
  <p>The getData function creates and compresses the file (it exists I can reach it directly when I look where the app is saved).</p>
  
  <pre><code>exports.getData = function getData(req, res, next){
    var listRequest = req.body.params.listURL;
    var stringTags = req.body.params.tagString;
    //The name of the compressed CSV file
    var nameFile = req.body.params.fileName;
    var query = url.parse(req.url, true).query;
    //The function which create the file
    ApollineData.getData(listRequest, stringTags, nameFile)
      .then(function (response){
        var filePath = '/opt/mean.js/modules/apolline/client/CSVDownload/'+response;
        const file = fs.createReadStream(filePath);
        res.download(filePath, response);
      })
      .catch(function (response){
        console.log(response);
      });
  };
  </code></pre>
  
  <p>My main problem is to download this file directly in the browser without using any variable because it could be huge (like several GB). I want to download it and then delete it.</p>