示例#1
0
 /**
  * check function for filetype, filesize, and other restrictions.
  *
  * @param $file
  *
  * @return bool
  *
  * @throws UploadFileImageIsToBigException
  * @throws UploadFileIsToBigException
  * @throws UploadFiletypeNotAllowedException
  */
 public function checkFile($file)
 {
     if (parent::checkFile($file)) {
         // is image upload?
         if (!$this->isAllowedImageSize($file['tmpname'])) {
             throw new UploadFileImageIsToBigException($this->imgWidth . 'x' . $this->imgHeight);
         }
         if (!$this->isAllowedMinImageSize($file['tmpname'])) {
             throw new UploadFileImageIsToSmallException($this->imgWidth . 'x' . $this->imgHeight);
         }
     }
     return true;
 }