$extlimit = "no"; //Do you want to limit the extensions of files uploaded
$limitedext = array(".gif",".jpg",".png",".jpeg"); //Extensions you want files uploaded limited to.
$sizelimit = "no"; //Do you want a size limit, yes or no?
$sizebytes = "5000000"; //size limit in bytes
$dl = "http://tuscaroracamp.myvnc.com/uploads"; //url where files are uploaded
$absolute_path = "C:\Program Files\Abyss Web Server\htdocs\uploads"; //Absolute path to where files are uploaded
$websiteurl = "http://tuscaroracamp.myvnc.com"; //Url to you website
$websitename = "Tuscarora Camp";
if (!isset($action)) {
$action = "";
}
switch($action) {
default:
echo"
Upload Or Download Area
Upload File
Download File
Return to $websitename
Powered by Abyss Web Server
";
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 Abyss Web Server
";
break;
case "upload":
echo"
File Upload
Powered by Abyss Web Server
";
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;
}
?>