title: Download zip folder with REST request in javascript. React.js
body: <p>I am sending request to download zip folder from server, which is sending me below response - (Zip folder in bytes)</p>
  
  <pre><code>PK�s�H  test.txt~���T*-N-R�R*I-.Q���PK�/[�PK�s�Htest.txt���T*-N- R�R*I-.Q���PK�/[�PK�s�H�/[�    test.txt~PK�s�H�/[�Ltest.txtPKm�
  </code></pre>
  
  <p>In react I have written below function to download the zip folder.I am getting error while extracting zip folder.</p>
  
  <pre><code>   downloadUtmFile: function() {
        function download(text, name, type) {
          var a = document.createElement("a");
          var file = new Blob([text], {type: type});
          a.href = URL.createObjectURL(file);
          a.download = name;
          a.click();
       }
          DashboardStore.downloadFile(API_ENDPOINT.utmFileDownload).then(function(result) {
          download(result,'', 'application/zip');
      }.bind(this), function(error) {
          this.setState({
              message: error
          });
      }.bind(this));
  },
  </code></pre>
  
  <p>I am using Blob and passing it type as "application/zip"
  While extracting the zip folder it is throwing me error.</p>