title: Download a zip file in reactjs without any plugins
body: <p>I am getting a response from a rest api whose <code>Content-Type</code> is <code>text/html</code> and <code>Content-Encoding</code> is <code>gzip</code>.</p>
  
  <p>I tried to download it using blob</p>
  
  <pre><code>const blob = new Blob([res], { type: 'application/gzip' });
  const downloadUrl = URL.createObjectURL(blob);
  const a = document.createElement('a'); 
  a.href = downloadUrl;
  document.body.appendChild(a);
  a.click();
  </code></pre>
  
  <p>But the downloaded gz file was not able to open (seems to be corrupted).
  can some one help me with downloading zip file in <code>reactjs</code>.</p>
  
  <p>Edit: require a solution without using any external plugins</p>