+if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
I think this check is superfluous. $_FILES['userfile']['tmp_name'] always contain an uploaded file.
Well, not if some maliciosly included code dealt with the files array before... But then that maliciosly included code would be able to do anything anyway :)
Goba
