lib/Http/FileUpload.php
public function saveTo($targetPath)
    {
        if ($this->hasError()) {
            // We cannot process a file that has errored (empty, incomplete, blocked, ...)
            return false;
        }

        if ($this->getFileSize() <= 0) {
            // We cannot process empty source files
            return false;
        }

        if (!$this->didMove) {
            $moveOk = move_uploaded_file($this->getTemporaryPath(), $targetPath);
        } else {
            $moveOk = copy($this->getCurrentPath(), $targetPath);
        }

        if ($moveOk) {
            $this->didMove = true;
            $this->currentPath = $targetPath;
        }

        return $moveOk;
    }
public function saveTo($targetPath)
    {
        if ($this->hasError()) {
            // We cannot process a file that has errored (empty, incomplete, blocked, ...)
            return false;
        }

        if ($this->getFileSize() <= 0) {
            // We cannot process empty source files
            return false;
        }

        if (!$this->didMove) {
            $moveOk = move_uploaded_file($this->getTemporaryPath(), $targetPath);
        } else {
            $moveOk = copy($this->getCurrentPath(), $targetPath);
        }

        if ($moveOk) {
            $this->didMove = true;
            $this->currentPath = $targetPath;
        }

        return $moveOk;
    }
public function saveTo ( $ targetPath ) { if ( $ this -> hasError ( ) ) { // We cannot process a file that has errored (empty, incomplete, blocked, ...) return false ; } if ( $ this -> getFileSize ( ) <= 0 ) { // We cannot process empty source files return false ; } if ( ! $ this -> didMove ) { $ moveOk = move_uploaded_file ( $ this -> getTemporaryPath ( ) , $ targetPath ) ; } else { $ moveOk = copy ( $ this -> getCurrentPath ( ) , $ targetPath ) ; } if ( $ moveOk ) { $ this -> didMove = true ; $ this -> currentPath = $ targetPath ; } return $ moveOk ; }
Moves the temporary file to a given location, or copies the previously moved file to a new location.
If the destination file already exists, it will be overwritten. The temporary file will be deleted.

@param string $targetPath The path to move the file to.
@return bool Returns true on success.
Moves the temporary file to a given location or copies the previously moved file to a new location . If the destination file already exists it will be overwritten . The temporary file will be deleted .