Skip to content

Instantly share code, notes, and snippets.

@baz1
Created October 1, 2015 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baz1/30529a4c2b62ca646de6 to your computer and use it in GitHub Desktop.
Save baz1/30529a4c2b62ca646de6 to your computer and use it in GitHub Desktop.
Create ZIP files within ZIP files with tiny_zip_js
// Requires https://raw.githubusercontent.com/vuplea/tiny_zip_js/master/tiny_zip.js
// From https://github.com/vuplea/tiny_zip_js/blob/master/tiny_zip.js
function inception(outerZIP, innerFinalZIP, innerZIPFileName, callback)
{
var innerData = innerFinalZIP.generate();
var reader = new FileReader();
reader.addEventListener("loadend", function() {
outerZIP.add(innerZIPFileName, new Uint8Array(reader.result));
callback();
});
reader.readAsArrayBuffer(innerData);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment