Jar preview problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Jar preview problem

    I have used below code for showing jar file preview,its working fine but when some jar file has not icon file then it not showing default icon
    PHP Code:
    <?
    include('vvv.php');
    $file = $_GET["lf"];
    $q = array("icon.png","ico.png","i.png","icono.png","Icon.png","Ico.png","I.png","Icono.png","ICON.png","ICO.png","I.png","ICONO.png","ICON.PNG","ICO.PNG","I.PNG","ICONO.PNG","icons/icon.png","icons/ico.png","icons/i.png","icons/icono.png","i","I");

    $zip = new PclZip($file);
    $ar = $zip->extract(PCLZIP_OPT_BY_NAME,$q,PCLZIP_OPT_EXTRACT_IN_OUTPUT);
    if(!empty($ar)) {Header("Content-type: image/png");
    }
    else {
    $cz=file_get_contents(MAI_TPL."ext/jar.png");
    header("Content-type: image/png");
    echo $cz;
    }
    ?>
    Last edited by Surya4u; 20.10.12, 03:28.

    #2
    what aut0index you are using sir?

    Comment


      #3
      Wap4ik autoindex

      Comment


        #4
        The problem is, this script only searches for few icon file names. If your jar's icon has another name, it won't show it.

        The easy way is, just open your jars, get find icon file name and add it to above icon name array.
        Best soution it, you have to read mainfest file and find icon file name. as my memory SEA SCRIPT has it.

        Comment


          #5
          Originally posted by Rksk View Post
          The problem is, this script only searches for few icon file names. If your jar's icon has another name, it won't show it.

          The easy way is, just open your jars, get find icon file name and add it to above icon name array.
          Best soution it, you have to read mainfest file and find icon file name. as my memory SEA SCRIPT has it.
          I have correctly pointed my default jar icon ,It has been set In directory "ext" as jar.png

          Comment

          Working...
          X