hello friends, i am facing a problem.. whenever i download wallpapers, ring-tone.. it is ok.. but when i download any jar , sis, nth etc.. then it only loads some txt ok similar size.. pls help.. here is the code of download.php ..
.. i want all thing to get proper download.
PHP Code:
<?php
include('./lite/header.inc.php');
include 'constant.php';
@$cf = $_GET["cf"];
@$file = $_GET["lf"];
@$lf = $_GET["lf"];
@$size = $_GET["sz"];
@$br = $_GET["br"];
if(preg_match("[http]",$lf)) exit(ERROR_MESAGE);
if(preg_match("[\.\.]",$lf)) exit(ERROR_MESAGE);
if(preg_match("[http]",$cf)) exit(ERROR_MESAGE);
if(preg_match("[\.\.]",$cf)) exit(ERROR_MESAGE);
$cf = str_replace('http://','',$_GET["cf"]);
$lf = str_replace('http://','',$_GET["lf"]);
$lf = str_replace('http','',$_GET["lf"]);
$cf = str_replace('http','',$_GET["cf"]);
$cf = str_replace('..','',$cf);
$cf = str_replace('/','',$cf);
$sz = filesize($lf);
$sz = round($sz/1024,1);
$t = filectime($lf);
$op = @file_get_contents("./about/$cf.txt");
$ck = @file_get_contents("./ck/$cf.dat");
$ckz = @file_get_contents("./ds/$cf.sc");
if($ck == '') $ck = 0;
if(empty($op)) $op = 'None';
echo 'File Name: <font color="#ff0000">'.$cf.'</font><br />
<a href="'.$lf.'">Download Here</a><br />
Size: '.htmlspecialchars($sz).' kb <br />
Uploaded: '.date("d.m.y",$t).'<br />
Downloads: '.$ckz.' times <br />';
if(file_exists('scr/'.$cf.'.png')) {
echo "Preview:<br /><img src=\"scr/$cf.png\" alt\"\" /><br />"; }
echo ' Description:<br /> '.htmlspecialchars($op).'<br />';
if(stristr($cf,'.zip')) {
echo '<a href="zip.php?lf='.$lf.'&cf='.$cf.'&br='.str_replace('..','',$br).'">View Contents of the Archive</a><br />';
}
if(stristr($cf,'.jar')) {
echo '<img src="file.png" alt=""/> <a href="jad.php?lf='.$lf.'&cf='.$cf.'&br='.str_replace('..','',$br).'"><b>Download jad</b></a><br />
<img src="ic.php?lf='.$lf.'" alt=""/> <br />';
}
echo '<a href="comm.php?cf='.$cf.'&lf='.$lf.'&br='.str_replace('..','',$br).'">Comments</a>'; echo ' ['.htmlspecialchars($ck).']';
@include 'ocenf.php';
echo '<hr><a href="index.php?a='.str_replace('..','',$br).'">Back</a>';
include('./lite/footer.inc.php');
?>
Comment