Jar preview problem

Started on the old forum in October 2012 · view the original in the archive · old links redirect here

4 replies · 612 views · started 14 years ago · 1 min read

3 participants
Surya4u Junior · 29 posts #1

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

<?
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;
}
?>
hi_jakkk Developer · 52 posts #2

what aut0index you are using sir?

Rksk Developer · 54 posts #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.

Surya4u Junior · 29 posts #5

Rksk wrote: 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

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close