title: Download files in Angular 7 (big files streaming)
body: <p>We are working on application where users will download many big files.</p>
  <p>When we started switching to Angular 7 we started using this approach(with modification to handle different browsers):</p>
  <pre><code>downloadFile(data: Response) {
    const blob = new Blob([data], { type: 'text/csv' });
    const url= window.URL.createObjectURL(blob);
    window.open(url);
  }
  </code></pre>
  <p>Above approach worked fine for small files. But when it comes to bigger files (1-5 GB in our case), in my understanding, in this case, file will be loading into the Blob Object and once download is completed it will throw the file to the browser and browser will write in Download folder of user machine. We want to start writing into Download directory of user immediately without storing to Blob object.</p>
  <p>So far for big files, we were using this approach:</p>
  <pre><code>  downloadFile(fileId: string) {
      window.location.href = `downloadFile?fileId=${fileId}`;
    }
  </code></pre>
  <p>We fire above method without subscribing on it. And server side will write into response writer so once response come, it will immediately start writing file in Download directory.</p>
  <p>Most of the time we stream SQL queries so sometimes getting result back from query itself will take some time. And while using second approach described above it seams like download is not working or stack. I cannot add any spinner because we are no subscribing.</p>
  <p>My question is what's the best way to download/stream big files in angular 7?</p>
  <p>We are good with second approach. There is any workaround to subscribe in this approach with avoiding to store into Blob object and write directly to Download folder?</p>
  <p>I can provide more details in the comments. Thank you!</p>