/**
  * The validation of file
  *
  * @param instanceof Attw\File\File $file
  * @return boolean
  */
 protected function realValidation(FileInterface $file)
 {
     if ($this->comparison == 0) {
         return $this->size >= $file->getSize();
     }
     return $this->size <= $file->getSize();
 }
Beispiel #2
0
 /**
  * Download a file
  *
  * @param instanceof Attw\File\File $file File to upload
  * @param string $directory Directory to upload file
  * @return boolean
  */
 public function upload(FileInterface $file, $directory)
 {
     return move_uploaded_file($file->getTmpName(), $directory . DIRECTORY_SEPARATOR . $file->getName());
 }