if (! @move_uploaded_file($this->path, $destination))
178 {
179 $error = error_get_last();
180 throw new \RuntimeException(sprintf('Could not move file %s to %s (%s)', basename($this->path), $targetPath, strip_tags($error['message'])));
181 }
182
183 @chmod($targetPath, 0777 & ~umask());
184
185 // Success, so store our new information
186 $this->path = $targetPath;
187 $this->name = $name;
188 $this->hasMoved = true;
189
190 return true;