开发者

How to use Zend_Validate_File_MimeType()?

I´m trying to use the zend mime validator and I´m doing this:

$mime = array('image/jpeg','image/gif');
$valid = new Zend_Validate_File_MimeType($mime);
if ($valid->isValid($_FILES['file']['name']){
// do some stuff
}
开发者_开发问答

But it not working, the documentation is weak, how can I use it??! THanks and best regard´s!


Use $valid->getMessages() to find out what happened

if ($valid->isValid($_FILES['file']['name']){
// do some stuff
} else {
$messages = $valid->getMessages();
print_r($messages);
}
//do the normal stuff
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜