title: Downloading a file from Azure Storage to client using Angular2 with .NET Web Api 2
body: <p>I am trying to download a 1GB file from blob storage into the client. I used before Memory Stream and I get OutOfMemory exception. </p>
  
  <p>now I am trying to open a read stream from the blob and send it directly to the client.</p>
  
  <pre><code> [HttpGet]
   [ResponseType(typeof(HttpResponseMessage))]
   public async Task&lt;HttpResponseMessage&gt; DownloadAsync(string file)
   {
       HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK);
       var stream = await blob.OpenReadAsync("container", file);
       result.Content = new StreamContent(stream);
       return result;
   }
  </code></pre>
  
  <p>The file is downloaded correctly, but the problem is: The code download the complete stream in the client, then the client sees the downloaded file. 
  <a href="https://i.stack.imgur.com/h6puf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h6puf.png" alt="enter image description here"></a>
  I wanted the client to see the file as being downloaded, so the user knows that he is downloading something. Not just blocking the request and wait till it finished.</p>
  
  <p>I am using FileSaver in Angular2:</p>
  
  <pre><code>this.controller.download('data.zip').subscribe(
        data =&gt; {
          FileSaver.saveAs(data, 'data.zip');
        });
  </code></pre>
  
  <p>Has anybody an idea how to fix it? </p>
  
  <p>Thank you!</p>