try this one
$disallowed=array('application/x-kdelnk', 'application/x-php3-preprocessed', 'application/x-php3', 'application/x-shellscript', 'application/x-rx', 'application/x-sh', 'application/core', 'application/x-executable', 'application/x-php', 'text/php', 'application/x-httpd-php', 'application/php', 'magnus-internal/shellcgi');
if (!in_array($_FILES['userfile']['type'], $disallowed)) {
doWhatEverYouWant (); // =P
} else {
luserTriedSillyStuffAlert();
}
sure, the file gets renamed
what would happen if somebody uploads a file with a filename already existing (your code doesn't seem to care about it ) ?
the original name is stored in $_FILES['userfile']['name'] and you can rename the file if you wish to...
regards =D