The file is available by referencing the superglobal $_FILES array. The first index is the form's input name and the second index can be either "name", "type", "size", "tmp_name" or "error".
$_FILES["file"]["name"] holds the name of the file uploaded from the client
$_FILES["file"]["type"] holds the mimetype of the uploaded file
$_FILES["file"]["size"] holds the size in bytes of the uploaded file
$_FILES["file"]["tmp_name"] holds the name of the temporary copy of the file stored on the server
$_FILES["file"]["error"] holds any error code resulting from the file transfer
However, you will want to keep in mind some of the potential hazards of allowing files to be uploaded to your server... be sure to use type, size and error in determining how to process the file.
} else echo "Sorry, we only accept .GIF images under 15Kb for upload."; ?>
Since the temporary file will be deleted once the script is done processing and the HTTP connection closes, our next task is to copy the temporary file to a safe location. For this we have the function move_uploaded_file.