예제 #1
0
파일: File.php 프로젝트: kuslahne/Upload
 /**
  * Upload file (delegated to storage object)
  *
  * @return bool
  * @throws \Upload\Exception If validation fails
  * @throws \Upload\Exception If upload fails
  */
 public function upload()
 {
     if ($this->isValid() === false) {
         throw new \Upload\Exception('File validation failed');
     }
     foreach ($this->objects as $fileInfo) {
         $this->applyCallback('beforeUpload', $fileInfo);
         $this->storage->upload($fileInfo);
         $this->applyCallback('afterUpload', $fileInfo);
     }
     return true;
 }
예제 #2
0
파일: File.php 프로젝트: prabhatse/olx_hack
 /**
  * Upload file (delegated to storage object)
  *
  * @return bool
  * @throws \Upload\Exception If validation fails
  * @throws \Upload\Exception If upload fails
  */
 public function upload()
 {
     if ($this->isValid() === false) {
         throw new Exception('File validation failed');
     }
     //Profiler::debugPoint(true,__METHOD__, __FILE__, __LINE__,$data);
     foreach ($this->objects as $fileInfo) {
         $this->applyCallback('beforeUpload', $fileInfo);
         $this->storage->upload($fileInfo);
     }
     $this->applyCallback('afterUpload', $fileInfo);
     return true;
 }