I have a form that allows users to select a zip file for upload. I'm trying to do client-side validation of this zip file before it is uploaded to my server since the upload might take a while and I'd also like to conserve bandwidth.
All I need to do is read a .csv file that should be included in the zip, and verify the presence of other files in the zip that are referenced in the .csv. To accomplish this, I am trying to use JSZip.
If the archive is small, this works great. If the archive is large (testing with ~500MB file) then Chrome crashes.
var reader = new FileReader();
reader.onload = function (e) {
console.log("Got here!");
// Read csv using JSZip, validate zip contents
};
reader.readAsArrayBuffer(file);
In my code I've commented out all of the logic in my onload callback and verified that none of that is causing the crash. I've discovered that Chrome crashes before the onload callback is ever called.
I've tested this in FireFox with much larger zip files and it works fine.