title: How to download multiple file in angular 2
body: <p>This is code to download file in angular 2. I want to download pdf, txt, docx, excel file with this code. I used file saver so can we download diffrent files on click of button.  </p>
  
  <pre><code>public downloadCSVFile()
     {
        this.downloadPdf().subscribe(
        (res) =&gt; 
           { 
              //console.log(res);   
              saveAs(res,'Frontend.xlsx')
           }
        );
     }
  
     public downloadPdf(): any 
     {
        let urls='assets/Files/Frontend.xlsx'
        let headers = new Headers();
        //headers.append('Authorization', 'JWT ' + localStorage.getItem('id_token'));
        return this.http.get(urls, { headers: headers,responseType: ResponseContentType.Blob }).map(
           (res) =&gt; {
              return new Blob([res.blob()], { type: 'application/vnd.ms-excel' })
           })
     }
  </code></pre>
  
  <p>This is my html code So how to download diffrent file. As file name displayed in table so i want that corrosponding file to be downloaded.</p>
  
  <pre><code>&lt;tr *ngFor ="let mydrive of providerMyDrive"&gt;
           &lt;td&gt;{{ mydrive.name }}&lt;/td&gt;
           &lt;td&gt;{{ mydrive.filetype }}&lt;/td&gt;
           &lt;td&gt;{{ mydrive.size }}&lt;/td&gt;
           &lt;td&gt;{{ mydrive.uploaddate }}&lt;/td&gt;
           &lt;td&gt;&lt;input type="button" (click)="downloadCSVFile()" value="Download"&gt;&lt;/td&gt;
           &lt;td&gt;&lt;/td&gt;
        &lt;/tr&gt;
  </code></pre>