/** * 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; }
/** * 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; }