title: Jszip and jszip-utils Meteor - currupt image files when saving a zip file
body: <p>Hi I am attempting to save image files using JSZip and JSZip-utils.</p>
  
  <p>I can package up the files but when trying to view them in windows the files are corrupt.</p>
  
  <p>Here is my code:</p>
  
  <pre class="lang-js prettyprint-override"><code>//returns a Jquery Promise (binary content for use in JSZip)
  if (currentViewOption == "f"|| currentViewOption == "t") {
    const downloadPromise = new Promise(resolve =&gt; {
      JSZipUtils.getBinaryContent(frontImgUrl, (err, data) =&gt; resolve(data));
    });
    zip.file(frontImgID, downloadPromise);
  }
  
  if (currentViewOption == "b"||currentViewOption == "t") {
    const downloadPromise2 = new Promise(resolve =&gt; {
      JSZipUtils.getBinaryContent(backImgUrl, (err, data) =&gt; resolve(data));
    });          
    zip.file(backImgID, downloadPromise2);
  }
  
  var now = Helpers.prettifyDateTime(new Date());
  
  //generation of the zip, and send to the users browser
  zip.generateAsync({type:"blob", compression: "DEFLATE"})
    .then(function(content) {
      saveAs(content, "VPI Images_" + now + ".zip");
    }, function(err){
      console.log(err)
  });
  </code></pre>
  
  <p>I would be very grateful if someone could assist, I have spent too long on this already.</p>
  
  <p>Thanks in Advance - Mark</p>