This is only the Error Processing portion of an uploading script.

It includes
"No File Selected"
"Unsupported File Type"
"File size is above limit"
Type errors.

It uses an Array for allowed file extensions, checks the extension using pathinfo on the upload file, Size is set by Megabytes (Then calculated into bytes :P)

all errors are in an Array, called "Errors" which is echoed out in an Unordered List at the very bottom of the page.

Some Commented code for Display All allowed files.

uses the variable "Processed" to check weather or not the file clears all required attrubites.

Minium Comments explaining some stuff.

<form action="" method="POST" enctype="multipart/form-data">

    <input type="file" name="file_uploader">
    <input type="submit" value="Upload">

PHP (Place Above/Below HTML, Your choice, Both Work.)
PHP Code:
//Defining some Variables for Error Checking.
    //Set File Size
$max "1";
$max = (($max 1024)*1024);

//Allowed File Types
$extensions = array("dem""png""jpg");

//Do not Edit Belo this Comment (:
    //Grabbing File Extension
$file $_FILES['file_uploader']['name'];
$ext pathinfo($filePATHINFO_EXTENSION);

//Other Stuffs :D    
$size $_FILES['file_uploader']['size'];
$processed false;
$errors[] = false;
//Some Basic Error Checking

$errors[] = "No File Selected";
    } else {
$errors[] = "Unsupported File Type.";
        } else {
$size $max){
$max = (($max/1024)/1024);
$errors[] = "File size is to large, max file size is {$max}Mb(s)";
            } else {
$processed true;

//If nothing came back as an error, continue with basic file processing and
    //Any MySQL Database information.

"No Errors. Please Continue.";

//Process all and any Errors.
$errors as $error){

//Testing Section, all Tests will be commented in the code for your enjoyment

    //Code to display all avaiable Extensions(Cleanly echo out the $extensions
    //Array, with a . before all exts.)
    // for($i=0; $i<count($extensions); $i++){
    //     echo '.'.$extensions[$i].' ';
    // }
If anyone wants to create the processing portion of this, go ahead (:

If theres a part that you dont understand, post a comment, i'll get back ASAP.