fileupload.php文件中:
[U]复制代码[/U] 代码如下:
//判断是否为图片
switch ($type){
case 'image/pjpeg'okType=true;
break;
case 'image/jpeg'okType=true;
break;
case 'image/gif'okType=true;
break;
case 'image/png'okType=true;
break;
}
上面是判断文件是否是图片类型,更多的文件类型,大家可以参考tomcat/conf/web.xml文件,这里面的文件类型很全....