예제 #1
0
파일: Uploader.php 프로젝트: znck/attach
 public function setFile(UploadedFile $file)
 {
     if (!$file->isValid()) {
         throw new UploadException();
     }
     $this->file = $file;
 }
예제 #2
0
 /**
  * Check if uploaded file is uploadable and an image.
  *
  * @return bool
  */
 private function isUploadableImage()
 {
     return $this->file->isValid() && in_array($this->file->getMimeType(), ['image/gif', 'image/jpeg', 'image/png']);
 }