【发布时间】:2011-10-08 23:18:07
【问题描述】:
我使用此代码检查图像的类型,
$f_type=$_FILES['fupload']['type'];
if ($f_type== "image/gif" OR $f_type== "image/png" OR $f_type== "image/jpeg" OR $f_type== "image/JPEG" OR $f_type== "image/PNG" OR $f_type== "image/GIF")
{
$error=False;
}
else
{
$error=True;
}
但有些用户抱怨他们在上传任何类型的图片时都会出错,而有些用户却没有收到任何错误!
我想知道这是否能解决问题:
if (mime_content_type($_FILES['fupload']['type']) == "image/gif"){...
有没有cmets?
【问题讨论】:
标签: php file-upload