I am uploading a zip folder and trying to read its XML file. The function can read the zip using JSZip but unable to retrieve the content of XML file.
readasText needs a blob object, I tried different things but it always gives type error.
upload: function (e) {
$("#fullPath").val(e.files[0].name);
if ($.browser.msie == undefined || ($.browser.msie && $.browser.version < 10) == false) {
$("#fullPath").val(e.files[0].name);
var zipFile = new JSZip();
zipFile.loadAsync(e.files[0].rawFile)
.then(function(zip) {
var reader = new FileReader();
reader.readAsText(zip.files);// type error: dont know how to access the xml file
reader.onloadend = function () {
GetValueFile(reader.result);
}
});
}
}
I want to give the XML result to the GetvalueFile function The file object is inside zip.files but I'm unable to retrive it.