Created
October 1, 2015 20:09
-
-
Save baz1/30529a4c2b62ca646de6 to your computer and use it in GitHub Desktop.
Create ZIP files within ZIP files with tiny_zip_js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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