if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))这个是图片限制
那限制RAR ZIP
text doc的文件类型怎么写?
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))这个是图片限制
那限制RAR ZIP
text doc的文件类型怎么写?
ZIP的MIME类型用application/x-zip-compressed
RAR的MIME类型用application/octet-stream
text的MIME类型有 text/plain
搜到个列表 http://www.wilf.cn/post/MIME_type.html
$mime = array(
'image/gif', 'image/jpeg', 'image/pjpeg', 'image/png'
);
$havethis = array_search( $_FILES["file"]["type"], $mime);
var_dump( ($havethis===false));