title: Download Blob xlsx file
body: <p>I'm pretty new one to angular and I need to create blob xlsx file. I have tried many different ways, like changing content-type to different formats etc. but nothing helps. I get error when I try to load xlsx file through Excel. If I download directly through URL it works fine. I have no idea what's wrong.</p>
  
  <pre><code>t.prototype.downloadXlsx = function () {
              var t = this, e = {
                  date_from: this.helpers.formatDate(this.filter.date_from),
                  date_to: this.helpers.formatDate(this.filter.date_to),
                  download: "fees"
              };
              this.http.get("team-accounts/" + this.route.snapshot.params.id, e).subscribe(function (n) {
                  var i = {type: 'application/octet-stream'},
                      r = t.account.team.name + "_summary_" + e.date_from + "_" + e.date_to + ".xlsx";
                  t.helpers.downloadXlsxFile(n._body, i, r);
              })
  
  t.prototype.downloadXlsxFile = function (t, e, n, i) {
              var r = new Blob(t], e);
              if (navigator.msSaveBlob) navigator.msSaveBlob(r, n); else {
                  var a = document.createElement("a");
                  if (void 0 !== a.download) {
                      var o = i || document.body, s = URL.createObjectURL(r);
                      a.setAttribute("href", s), a.setAttribute("download", n), a.style.visibility = "hidden", o.appendChild(a), a.click(), o.removeChild(a)
                  }
              }
  </code></pre>