"The uploaded file is not an image", self::NOT_DETECTED => "The type of uploaded file has not been detected", self::NOT_READABLE => "The uploaded file can not be read" ); $this->_messageTemplates = array_merge($this->_messageTemplates, $_messageTemplates); $mimeTypes = $this->getMimeType(true); if (!in_array('image/pjpeg', $mimeTypes)) { $mimeTypes[] = 'image/pjpeg'; $mimeTypes[] = 'image/bmp'; } // Tiff and Psd is not an image because it do not display in the browser $excludeMimeTypes = array('image/tiff', 'image/vnd.adobe.photoshop'); foreach ($excludeMimeTypes as $mimeType) { if (false !== ($index = array_search($mimeType, $mimeTypes))) { unset($mimeTypes[$index]); } } foreach($mimeTypes as $type) { $mimeTypes[] = $type . '; charset=binary'; } $this->setMimeType($mimeTypes); } }