title: How to avoid about:blank#blocked in browser when downloading file
body: <p>I'm trying to download a file from Node.js server and getting the download blocked by Chrome. After searching for the solution, I came across a <a href="https://stackoverflow.com/questions/55580542/aboutblankblocked-in-browser-when-dowload-file">similar question</a>.
  I added a <code>"Access-Control-Allow-Origin", "*"</code> to the header but still getting download blocked.</p>
  
  <p>The client-side code:</p>
  
  <pre class="lang-js prettyprint-override"><code>onClickLink: async function(oEvent) {
      const oModel = this.getView().getModel();
      const responseData = await getDocumentFile(documentFileName);
      let a = document.createElement("a");
      a.href = responseData;
      a.download = "file.docx";
      a.click()
  },
  
  function getDocumentFile(fileName) {
      const ip = location.host;
      let request = $.ajax({
          type: "POST",
          url: http() + ip + "/documentGetFile",
          responseType: "arraybuffer",
          headers: {
              "Accept": "application/docx"
          },
          data: {
              fileName: fileName
          },
          error: function (err) {
              console.log("ERROR: " + err);
          }
      });
      return request;
  }
  </code></pre>
  
  <p>The server-side:</p>
  
  <pre class="lang-js prettyprint-override"><code>app.post("/documentGetFile", async function (req, res, next) {
      const fileName = req.body.fileName;
      const downloadResult = await downloadFileFromAPI(fileName,
              CUSTOMER_CONFIG.default.data.fileFolder);
      // downloadResult.file returns a 15MB file
  
      res.setHeader("Content-Type", "application/docx");
      res.setHeader("Accept-Encoding", "base64");
      res.setHeader("Access-Control-Allow-Origin", "*");
      res.send(downloadResult.file);
      res.end();
  });
  </code></pre>