$extlimit = "yes"; //Do you want to limit the extensions of files uploaded
$limitedext = array(".w3g",".zip",".ace",".rar"); //Extensions you want files uploaded limited to.
$sizelimit = "yes"; //Do you want a size limit, yes or no?
$sizebytes = "200000"; //size limit in bytes
$dl = "http://www.running-death.host.sk/replays"; //url where files are uploaded
$absolute_path = "/mnt/host-users/running-death/replays"; //Absolute path to where files are uploaded
$websiteurl = "http://www.running-death.host.sk"; //Url to you website
$websitename = "Running Death";
switch($action) {
default:
echo"
Upload Or Download
Upload File
Download File
Return to $websitename
Powered by PHP Uploader Downloader
";
break;
case "download":
echo "
File Download
Upload File Return to $websitename";
$list = "";
$list .= "Click To Download |
";
$dir = opendir($absolute_path);
while($file = readdir($dir)) {
if (($file != "..") and ($file != ".")) {
//Download files with spaces fix by Kokesh
$list .= "$file |
";
}
}
$list .= "
";
echo $list;
echo"
Powered by PHP Uploader Downloader
";
break;
case "upload":
echo"
File Upload
Powered by PHP Uploader Downloader
";
break;
//File Upload
case "doupload":
$dir = "dir";
if ($file != "") {
if (file_exists("$absolute_path/$file_name")) {
die("File already exists");
}
if (($sizelimit == "yes") && ($file_size > $sizebytes)) {
die("File is to big. It must be $sizebytes bytes or less.");
}
$ext = strrchr($file_name,'.');
if (($extlimit == "yes") && (!in_array($ext,$limitedext))) {
die("The file you are uploading doesn't have the correct extension.");
}
@copy($file, "$absolute_path/$file_name") or die("The file you are trying to upload couldn't be copied to the server");
} else {
die("Must select file to upload");
}
echo "
File Uploaded
";
echo $file_name." was uploaded";
echo "
Upload Another File
Download File
Return to $websitename
Powered by PHP Uploader Downloader
";
break;
}
?>