title: Set File Name while downloading via blob in Angular 5
body: <p>Below is my Typescript code to download file From API </p>
  
  <pre class="lang-js prettyprint-override"><code>DownloadLM() {
  var ID= sessionStorage.getItem("UserID");
      return this.http.get(this.baseurl + 'api/DownloadFiles/DownloadLM/' + ID,
        {
          headers: {
            'Content-Type': 'application/json'
          },
          responseType: 'arraybuffer'
        }
      )
        .subscribe(respData =&gt; {
          this.downLoad(respData, this.type);
        }, error =&gt; {
        });
    }
  
    downLoad(data: any, type: string) {
      var blob = new Blob([data], { type: type.toString() });
      var url = window.URL.createObjectURL(blob);
      var pwa = window.open(url);
      if (!pwa || pwa.closed || typeof pwa.closed == 'undefined') {
        alert('Please disable your Pop-up blocker and try again.');
      }
    }
  </code></pre>
  
  <p>This is Fine to download Excel File , but it gives a random name to file which I don't want , I want to set file name of my choice when downloading it , </p>
  
  <p>Where can I set file name here ? any property of Blob ?</p>