Q:

How to validate file upload field? 

I can't seem to validate file upload fields, here's my code:
<? php

    if (isset($_POST['submit'])) {
        if ($_POST['uploadFile']) {
            echo "File uploaded";
        } else {
            echo "No file attempted to be uploaded";
        }
    }

? >

<form action="" method="post" enctype="multipart/form-data">
    <input type="file" name="uploadFile" />
    <input type="submit" name="submit" />
</form>

What is the mistake I'm making? 
EDIT
Came up with my own solution, may not be the best but it works:
if (isset($_POST['submit'])) {
    $fileUpload = $_FILES['uploadFile'] ['name'];
        if (strlen($fileUpload) > 0) {
            echo "File uploaded."; 
        } else {
            echo "No File attempted to be uploaded."; 
        }
}

A:

the superglobal your are looking for is $_FILES. 
var_dump($_FILES); //to see what's happening with the uploaded files

To make sure a POST request is made you can use the following lines: 
if($_SERVER['REQUEST_METHOD'] == 'POST') {
   //A post request! 
}

