25 #require_once 'Zend/Validate/File/MimeType.php'; 48 self::FALSE_TYPE =>
"File '%value%' is not compressed, '%type%' detected",
49 self::NOT_DETECTED =>
"The mimetype of file '%value%' could not be detected",
50 self::NOT_READABLE =>
"File '%value%' is not readable or does not exist",
61 $mimetype = $mimetype->toArray();
71 'application/vnd.ms-cab-compressed',
72 'application/x-ace-compressed',
74 'application/x-archive',
77 'application/x-bzip2',
78 'application/x-cab-compressed',
79 'application/x-compress',
80 'application/x-compressed',
82 'application/x-debian-package',
85 'application/x-java-pack200',
87 'application/x-lharc',
93 'application/x-stuffit',
101 if (is_array($mimetype)) {
103 if (array_key_exists(
'magicfile', $temp)) {
104 unset($temp[
'magicfile']);
107 if (array_key_exists(
'headerCheck', $temp)) {
108 unset($temp[
'headerCheck']);
112 $mimetype += $default;
116 if (empty($mimetype)) {
117 $mimetype = $default;
120 parent::__construct($mimetype);
131 protected function _throw($file, $errorType)
133 $this->_value = $file[
'name'];
146 $this->
_error($errorType);
_error($messageKey, $value=null)
_throw($file, $errorType)
__construct($mimetype=array())