switch ($_FILES['userfile']['type'])
{
case "image/pjpeg":
$fileextname = "jpg";
break;
case "image/gif":
$fileextname = "gif";
break;
case "image/x-png":
$fileextname = "png";
break;
case "application/x-shockwave-flash":
$fileextname = "swf";
break;
case "text/plain":
$fileextname = "txt";
break;
case "application/msword":
$fileextname = "doc";
break;
case "application/x-zip-compressed":
$fileextname = "zip";
break;
}
你问我答->php
