3 Replies Latest reply on Mar 2, 2016 5:46 AM by Loic.Aigon

    unzip files on local system

    aviR Level 1

      hii all

      Why is this code not running?

      Please helppp

       

       

      var readFile=function(){

           $("#status").html("<br/>");

      var url= $("somefile.zip").val();

      var donReading=function(zip){

          WithEntries(zip);

              };

      var zipFile = new  ZipFile(url, doneReading);

      };

      function  WithEntries(zip){

      $('#report').accordion('destroy');

             $("#report").html('');

        var extractCb = function(id) {

              // this callback is invoked with the entry name, and entry text

              // in my demo, the text is just injected into an accordion panel.

              return (function(entryName, entryText){

                  var content = entryText.replace(new RegExp( "\\n", "g" ), "<br/>");

                  $("#"+id).html(content);

                  $("#status").append("extract cb, entry(" + entryName + ")  id(" + id + ")<br/>");

                  $('#report').accordion('destroy');

                  $('#report').accordion({collapsible:true, active:false});

              });

          }

      for(var i=0;i<zip.entries.length;i++)    {

      var entry=zip.entries[i];

      var entryinfo= "<h4><a>" + entry.name + "</a></h4>\n<div>";

          }

      }