问题解决
$filetype=$_FILES['userfile']['type']; 
echo"$filetype"; 就可看到上传文件的mime类型. 
ZIP的MIME类型用application/x-zip-compressed 
RAR的MIME类型用application/octet-stream 你的代码可修改为: 
switch ($_FILES['userfile']['type']) { 
case "application/x-zip-compressed": 
break; 
case "application/octet-stream": 
break; 
case "text/plain": 
break; 
default: 
print "您上传的文件类型不对"; 
exit(0); 
break; 
}