Invalid filename"; exit; } $urlhost=$url[host]; if ($url[host]!=$mydomain1 && $url[host]!=$mydomain2){ print "

Access Denied


if you have a problem please contact admin at contact me
URL Host:($urlhost);
domain 1: ($mydomain1);
domain2: ($mydomain2);


"; exit; } else { if (ereg("$file",httpvar(PHP_SELF))){ print ""; exit; } global $ext; $filename=$file; sendfile($filename); } function sendfile($filename){ global $type,$dlpath,$ext,$dlspeed; $file="$dlpath/$filename"; $ext=substr(strrchr($filename, '.'), 1); $mtype=$type[$ext]; if ($mtype==""){ echo "

We are sorry but we do not support this file extension $ext"; exit; } if (!file_exists($file)){ echo "

File does not exist"; exit; } if(ini_get('zlib.output_compression')){ ini_set('zlib.output_compression', 'Off'); } //flush(); $file_size = filesize($file); $fp = fopen($file, 'r'); header('Expires: 0'); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: $mtype"); header("Accept-Ranges: bytes"); $user_agent = strtolower(httpvar(HTTP_USER_AGENT)); if ((is_integer(strpos($user_agent, "msie"))) && (is_integer (strpos($user_agent, "win")))){ header("Content-Disposition: filename=".basename($filename).";" ); } else { header("Content-Disposition: attachment; filename=".basename($filename).";"); } header("Content-transfer-encoding: binary"); header("Content-Length: $file_size"); $dlspeed = 0;# download speed limit in kb. # example: put 3 and it would be 3kb etc # set it to 0 to disable download speed limit. $speed="4096"; if ($dlspeed!=0){ $speed=round($dlspeed*1024); } while (!feof($fp)){ echo(fread($fp, $speed)); if ($dlspeed!=0){ flush(); sleep(1); } } fclose($fp); exit; } ?>