title: How to save binary data of zip file in Javascript?
body: <p>I am getting below response from AJAX respose:</p>
  
  <p>this is response of zip file.
  please let me know how to save this filename.zip in Javascript. Inside the ZIP there is PDF file.</p>
  
  <p>MY code is like this: </p>
  
  <pre><code>$.ajax({
  
      url: baseURLDownload + "/service/report-builder/generateReportContentPDF",
      beforeSend: function (xhr) {
          xhr.setRequestHeader("Access-Control-Allow-Origin", "*");
          xhr.responseType = 'arraybuffer'
      },
      type: "POST",
      data: JSON.stringify(parameter),
      contentType: "application/json",
      success: function(result) {
          console.log("ssss-&gt;"+result);
          var base64String = utf8_to_b64(result);
          //window.open("data:application/zip;base64,"+base64String); // It will download pdf in zip
          var zip = new JSZip();
          zip.add("PDFReport.pdf", result);
          content = zip.generate();
          location.href="data:application/zip;base64," + content;
          $.mobile.loading('hide');
  
      },
      error: function(xhr){
          console.log("Request Status: " + xhr.status + " Status Text: " + xhr.statusText + " " + xhr.responseText);
          $.mobile.loading('hide');
          showAlert("Error occured. Unable to download Report", "Message", "OK");
  
      }
  });
  </code></pre>
  
  <p>RESPOSE Console.log("ssss->"+result);</p>
  
  <p>PK��Q��F���������������/crt_pdf_10204725.pdf��uX\M�8|p�����݃�;w�@p  �ܝBp��݂�;|C�ھ�w������=O���]]�%�N�����#+�reup����������Y������̉�J����3)� O��C����F�M�P�&amp;�����rA�@��7T.��z(%h��x�<em>x0�0Z�-i��%q�e�M�����i�"�c��-/��j��齔/ļL瞄�0� ��  >�o��[<code>��6  멆�n��s�$�
  �#&gt;˘ '��wT�� ���3�36DK�+�̓�t6 ��r��sA:���x�&lt;&gt;n������'U��RLqA+���ݺ�BM��:4ĞP�}���:�}ߣP����?F)�9-�W0���2�{x��#2v8N.$V�&gt;X=/�+�c}���ּ�\y���\*�J\��
  ���90�T�L� 3p���*Sfj(���PWWz��O�s�9]&amp;�</code>���iO|�9�;�5��ʘdW�cl%    �%;����u���%[�5������Q]$��[L>���yXg�9��2+&amp;,iFs�Q�����u�.�E(�>W</em>��+��M ؟E������i|<code>���k�k�c蟴CcG�j��4s|x �F</code>1�}��Y��,29�0M=-O����m\L��y��^On^���\���u��a���F9:zc�Sy�-�g��fu�n�C�T:{
  ��4&amp;/
  ��LM9�98�
  �&amp;Pnc�!��m�r�~��)74�04��0�0������M�~"��.ikjG��M�-