Skip to content

Instantly share code, notes, and snippets.

@baz1
baz1 / inception.js
Created October 1, 2015 20:09
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();