title: How to get interim response in Angular HTTP - ArrayBuffer
body: <p>I'm having a Electron application internally I'm loading the Angular application. I'm downloading a byte array (i.e., ArrayBuffer) through an API call and passing those data to a method which I'm connecting through electron.remote.require('./file-service') to create a file in a local file system.</p>
  
  <p>If the User changes the route, a popup window will prompt to get the confirmation of navigation. If the User clicks ok and the http request is in between, I need to store the received bytes.</p>
  
  <p><strong>Sample Angular Code:</strong></p>
  
  <pre><code>declare var electron: any;
  const { createDataFile } = electron.remote.require('./file-service')
  
  const payLoad = new FormData();
  const httpOptions =  {
        headers: new HttpHeaders(),
        reportProgress: true,
      };
  
  const req = new HttpRequest('GET', 'http://localhost:8080/getData', payLoad, {...httpOptions, responseType: 'arraybuffer'});
  this.http.request&lt;ArrayBuffer&gt;(req).subscribe((event: HttpEvent&lt;ArrayBuffer&gt;) =&gt; {
  
      switch (event.type) {
          case HttpEventType.DownloadProgress:
              // This method will manipulate and show the progress bar in the UI
              this.updateProgress(event.loaded);
          break;
          case HttpEventType.Response:
              createDataFile(event.body)
          break;
      }
  
  });
  </code></pre>
  
  <p>I'm trying to save data, If the arraybuffer size is 25MB and I received 12MB and I'm trying to navigate away, in that moment I need to store that 12MB.
  Kindly assist me how to get the interim response.</p>