<?php Tutorial
if ($_files[' file ']) {
// ----------------------------------------------------------------------------------------------//
//
Description: File Upload date: 2004-5-2
//
// ----------------------------------------------------------------------------------------------//
PHP Simple utility File Upload code
Upload Settings
$maxsize = 10002400; Maximum allowable file size for uploading
$alltype =array (". php", ". PhP3"); All file types that are allowed to upload
$imgtype =array (". php", ". PhP3"); Type
Determine file size
if ($_files[' file '] [' size ']> $maxsize) {
echo "You are uploading more data than 10000k";
Exit
}
Determining File Types
$type =strstr ($_files[' file '] [' name '], ".");
if (In_array ($type, $alltype)) {
echo "does not allow uploading of this type of file";
Exit
}
Include './uploaddir.php ';
$time =date ("Ymd-his", Time ());
$FN = $time. $type;
$destination = $updir. " /". $fn;
if (@move_uploaded_file ($_files[' file '] [' tmp_name '], $destination)) {
@chmod ($destination, 0777);
$fileurl = $updir. " /". $destination;
$fileurl = "". $destination;
}else{
echo "Upload failed!";
echo "<script>location.href=history.back () </script>";
}
// ----------------------------------------------------------------------------------------------//
}
if ($back = = "No"):
echo "OK";
Exit
endif
?>