Home > front end >  Js front unzip the files and parses the content, now I already can extract, get the file name, then
Js front unzip the files and parses the content, now I already can extract, get the file name, then

Time:01-14

$(" # file "). Change (function (e) {
Var file=enclosing files [0];
Window. The UN=new UnZipArchive (file);
UN. GetData (function () {
Var arr=UN. However, ();
Var STR="";
for(var i=0; iThe console. The log (UN. GetEntry (arr [I]));
/* UN. GetEntry (arr) [I]. Arr [I]; */
Var TXT=arr [I] charAt (arr [I] length - 1);
The console. The log (" terminator: "+ TXT);
If (TXT! {
="/")
STR +="& lt; Li onclick=showContent (" "+ arr [I] +" ") & gt;" + + arr [I] ";
}
}
$(" # dir "). The HTML (STR);
});
});

How do you spell arr [I] is the file name and path, in the end of the file content is displayed, showContent () method of how to write, ask the great spirit show

CodePudding user response:

2021, the original poster can have a solution?
  • Related