<?php
  //created by Parul Kudtarkar
  //copyright Echinobase 2014
//$basedir='./download/';
//$basedir='';
ini_set('memory_limit', '-1');
$yourfile= isset($_GET['file']) ? $_GET['file'] : '';

if(preg_match('#/#', $yourfile))
{ header("Status: 403");
die("Illegal Access request: denied");
}

if ((isset($yourfile))&&(file_exists($yourfile))) {
	header("Content-type: application/force-download");
	header("Content-Type: application/octet-stream");
	header("Content-Type: application/download");	
	//header ("Content-Disposition: attachment; filename=$yourfile");
	header("Content-Disposition: attachment; filename=".basename($yourfile).";");
	header("Content-Length: ".filesize(htmlspecialchars("$yourfile")));
	readfile(htmlentities("$yourfile")); 
	//$fp = fopen("$yourfile", "r");
	//fpassthru($fp);
} else { 
       echo "File $yourfile does not exist"; 
    } //end if 
    
?>
