I have a zip with a bunch of folders containing one or more png-files each that I want to render to the DOM.
zip.loadAsync(file) .then(function(zip) {
zip.file('textfile.txt')
.async("string")
.then(function (content) { console.log(content); });
}, function (e) {
console.log("Error reading " + file.name + " : " + e.message); });
I can read a text file, but I'm stuck when it comes to getting the binary data from an image file.
My thought is that I should use URL.createObjectURL( blob ) to create a reference to the files and then render <img id="output" src="blob:null/341e9aeb-a794-4033-87f5-e8d075e9868a">
for each image in the zip.
How can I get the images from the zip?
Thanks!
Blob
fromdata URI
is described at #4999408 – Orndorff