framework/web/UploadedFile.php
public function saveAs($file, $deleteTempFile = true)
    {
        if ($this->error == UPLOAD_ERR_OK) {
            if ($deleteTempFile) {
                return move_uploaded_file($this->tempName, $file);
            } elseif (is_uploaded_file($this->tempName)) {
                return copy($this->tempName, $file);
            }
        }

        return false;
    }
public function saveAs($file, $deleteTempFile = true)
    {
        if ($this->error == UPLOAD_ERR_OK) {
            if ($deleteTempFile) {
                return move_uploaded_file($this->tempName, $file);
            } elseif (is_uploaded_file($this->tempName)) {
                return copy($this->tempName, $file);
            }
        }

        return false;
    }
public function saveAs ( $ file , $ deleteTempFile = true ) { if ( $ this -> error == UPLOAD_ERR_OK ) { if ( $ deleteTempFile ) { return move_uploaded_file ( $ this -> tempName , $ file ) ; } elseif ( is_uploaded_file ( $ this -> tempName ) ) { return copy ( $ this -> tempName , $ file ) ; } } return false ; }
Saves the uploaded file.
Note that this method uses php's move_uploaded_file() method. If the target file `$file`
already exists, it will be overwritten.
@param string $file the file path used to save the uploaded file
@param bool $deleteTempFile whether to delete the temporary file after saving.
If true, you will not be able to save the uploaded file again in the current request.
@return bool true whether the file is saved successfully
@see error
Saves the uploaded file . Note that this method uses php s move_uploaded_file () method . If the target file $file already exists it will be overwritten .