This script will work if you have PHP Enabled on your server:
PHP Code:
<html>
<head>
<title><?php echo ($_GET['file']) ? "Download ".$_GET['file'] : "Downloader"; ?></title>
<script type="text/javascript">
function countDown(el,count){
document.getElementById(el).innerHTML='<center><button onClick="void(0)" disabled="yes">'+count+' more seconds till download</button></center>';
count -= 1;
if(count != -1){
setTimeout("countDown('"+el+"',"+count+")",1000);
} else {
document.getElementById(el).innerHTML='<center><button onClick="downloadFile(\'<?=$_GET['file']?>\')">Click to download.</button></center>';
}
}
function downloadFile(file){
window.location=file;
}
</script>
</head>
<?php
if($_GET['file']){
if(file_exists($_GET['file'])){
echo "
<body onLoad=\"countDown('download',10)\">
<div align='center'>
File Name: <b>".$_GET['file']."</b> <br />
File Size: <b>".filesize($_GET['file'])." bytes</b></br />
File format: <b>".ucfirst(substr($_GET['file'],strlen($_GET['file'])-3))."</b></div><br />
<span id='download'><center><noscript>If your seeing this message, please enable javascript</noscript></center></span>
</body>
";
} else {
die('File doesn\'t exist');
}
} else {
echo "<body><h1 align='center'>No file specified...</h2></body>";
}
?>
</html>
It will also only work if your using rar, zips, etc...
Save this as download.php, to direct some one to a download:
http://<code style="background-color...website</code>.com/download.php?file=file.zip
I hope this works for you. If it doesn't and you have text display like this:
File Name: ".$_GET['file']."
File Size: ".filesize($_GET['file'])." bytes
File format: ".ucfirst(substr($_GET['file'],strlen($_GET['file'])-3))."
"; } else { die('File doesn\'t exist'); } } else { echo "
No file specified...
"; } ?>
Then please contact your host and ask them to enable PHP.
Bookmarks