style.css:
[code]

* {
  font-family: Geneva, Verdana, Arial, Bitstream Vera Sans, Helvetica, sans-serif;
  line-height: 1.4em;
}

body, p {
  font-size: 12px;
}

address {
  margin-top: 24px;
}

div.Link {
  text-align: right;
}

div.Link a {
  padding: 6px;
  margin: 12px;
  border: 1px solid silver;
  text-decoration: none;
  background-color: #efefef;
}

div.Link a:hover {
  color: red;
  background-color: #cdcdcd;
}

.Library {
  border: 1px solid silver;
  padding: 12px;
}

.Library img {
  vertical-align: middle;
  border: 0px;
}

.Library a {
  color: black;
  text-decoration: none;
  padding: 2px;
  padding-left: 6px;
  padding-right: 12px;
}

.Library a:hover {
  color: navy;
  background-color: #cdcdcd;
}
[/code]
Index.php:
[code]
<?php
$rootmap = "/downloadmap";
$rootmap = str_replace("../", "", $rootmap);
$rootmap = str_replace("./", "", $rootmap);
$rootmap = str_replace("/..", "", $rootmap);
$rootmap = str_replace("/../", "", $rootmap);
$rootmap = str_replace(".", "", $rootmap);
$rootmap = str_replace(chr(92), "", $rootmap);
$rootmap = str_replace("?", "", $rootmap);   

if(isset($_GET["download"]))
{
	if (strstr($_SERVER["HTTP_REFERER"], "yoursite.eu"))
	{
		if(file_exists($rootmap.$_GET['p']."/".$_GET['download']))
		{
			$size = filesize($rootmap.$_GET['p']."/".$_GET['download']);
			header("Content-Length: $size");
			header('Content-type: Application/octet-stream');
			header('Content-Disposition: attachment; filename='.$_GET['download']);
			readfile($rootmap.$_GET['p']."/".$_GET['download']);
		}
		else
		{
			echo "File does not exist";
		}
		exit();
	}
	else
	{
		echo "<h1>Antileech activated</h1>";
		echo "You are not comming from: <b>www.yoursite.eu</b>";
		exit();
	} 
}

function size($size, $retstring = null)
{
	$sizes = array('Bytes', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
	if ($retstring === null)
	{
		$retstring = '%01.2f %s';
	}
	$lastsizestring = end($sizes);
	foreach ($sizes as $sizestring)
	{
		if ($size < 1024)
		{
			break;
		}
		if ($sizestring != $lastsizestring)
		{
			$size /= 1024;
		}
	}
	if ($sizestring == $sizes[0])
	{
		$retstring = '%01d %s';
	}
	return sprintf($retstring, $size, $sizestring);
}

function array_files($rootmap)
{
	if (file_exists($rootmap))
	{
		$dir = opendir($rootmap);
	}
	else
	{
		echo "Directory does not exist.";
		exit();
	}
	
	if (isset($_GET['p']) ? $_GET["p"] : "")
	{
		$pathEnc = str_replace("%2F", "/", rawurlencode($_GET['p']));
		$page_up = substr($pathEnc, 0, strrpos($pathEnc, "/"));
		echo "<tr><td><a href='index.php?p=". $page_up ."'>[Up]</a></td></tr><tr><td></td></tr><tr><td></td>";
	}
	
	while (false !== ($file = readdir($dir)))
	{
		if($file != "." && $file != ".." && $file != "Thumbs.db" && $file != "index.php" && $file != ".htaccess" && $file != "temp")
		{			
			if (is_dir($rootmap."/".$file))
			{
				$page = $_GET['p'];
				echo "<tr><td><a href='index.php?p=".$page."/".$file."'><img src='./folder.gif' alt='(x)' /> " .$file. "</a></td></tr>";
			}
			else
			{
				$size = filesize($rootmap."/".$file);
				$filesize = size($size, $retstring = null);
				$ext = strrchr($file, ".");
				$ext = str_replace(".", "", $ext);
				echo "<tr><td><a href='index.php?p=".$page."&download=".$file."'><img src='./".$ext.".gif' alt='(x)' /> ".$file."</a></td><td>FileSize: " .$filesize. "</td></tr>";
			}

		}
	}
	closedir($dir);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<titleDownload Library</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>

<body>
<h1>Download Library</h1>
<h2><?php echo str_replace("/", " &raquo; ", $_GET['p']) ?></h2>
<div class="Link"></div>
<div class="Library">
<table align="center" cellpadding="0" cellspacing="0" width="100%">
<?php
if(isset($_GET["p"]))
{
	array_files($rootmap.$_GET["p"]);
}
else
{
	array_files($rootmap);
}
?>
</table>
</div>
<address>www.yoursite.eu</address>
</body>
</html>
[/code]
