How to save zip file represented as a string in Node js
<p>I have a response from an ebay-api </p>

<blockquote>
  <p>--MIMEBoundaryurn_uuid_C91296EA5FF69EE9571479882375576565344 Content-Type: application/xop+xml; charset=utf-8; type="text/xml"
  Content-Transfer-Encoding: binary Content-ID:
  &lt;0.urn:uuid:C91296EA5FF69EE9571479882375576565345></p>
  
  <p>Success1.1.02016-11-23T06:26:15.576Z514
  --MIMEBoundaryurn_uuid_C91296EA5FF69EE9571479882375574545344 Content-Type: application/zip Content-Transfer-Encoding: binary
  Content-ID: </p>
  
  <p>PKY'uIi[��@�50014028337_report.xmlUT  y�2Xy�2Xux
                                                             00�R�j�@��+��[��PlX#�(�x,=l�q]Lfewc��w Ĥ��O��١�HT���t��GGT� 
  ��6�;���'������.$����=d����m;c}Wߦ�RW�A
  f�����g�I��4U��x��3��f���ғ{f��xj�,+���ۖI%5��B's��G,#��t,L{�c�����MD笓��)!�9��
          �M�o;8_��&lt;�i�y����sz���u���=��Ջ^2�S��%+2�2�`QV�$�����~?�w�ǥ�_Q�퉦�'PKY'uIi[��@���50014028337_report.xmlUTy�2Xux
                                                                                                                                    00PK\�
  --MIMEBoundaryurn_uuid_C91296EA5FF69EE9571479882375576565344--</p>
</blockquote>

<p>This is of type string. and i extracted the attached zip file data i.e.</p>

<blockquote>
  <p>PKY'uIi[��@�50014028337_report.xmlUT  y�2Xy�2Xux
                                                             00�R�j�@��+��[��PlX#�(�x,=l�q]Lfewc��w Ĥ��O��١�HT���t��GGT� 
  ��6�;���'������.$����=d����m;c}Wߦ�RW�A
  f�����g�I��4U��x��3��f���ғ{f��xj�,+���ۖI%5��B's��G,#��t,L{�c�����MD笓��)!�9��
          �M�o;8_��&lt;�i�y����sz���u���=��Ջ^2�S��%+2�2�`QV�$�����~?�w�ǥ�_Q�퉦�'PKY'uIi[��@���50014028338_report.xmlUTy�2Xux
                                                                                                                                    00PK\�</p>
</blockquote>

<p>This shows that it has a report.xml in it. So when i write this data in a zip file, it creates a zip file and upon extract gives error.</p>

<pre><code>fs.writeFile("./static/DownloadFile.zip", fileData, 'binary', function(err){
                  if (err) throw err;
                  console.log("success");
                  });
</code></pre>

<p>How can i write this data in a zip file properly. Pls advice. If required any more information. </p>

<p><strong>EDIT:
I tried writing the zip file in PHP and is succssfully writing it with this code:</strong></p>

<pre><code>$zipFilename="DownloadFile.zip";
        $data       =   $fileData;
        $handler = fopen($zipFilename, 'wb')
            or die("Failed. Cannot Open $zipFilename to Write!&lt;/b&gt;&lt;/p&gt;");
        fwrite($handler, $data);
        fclose($handler);
</code></pre>

<p>Please advice how can i achieve the same thing in nodejs.</p>