Swat/SwatFileEntry.php
public function saveFile($dst_dir, $dst_filename = null)
    {
        if (!$this->isUploaded()) {
            return false;
        }

        if ($dst_filename === null) {
            $dst_filename = $this->getUniqueFileName($dst_dir);
        }

        if (is_dir($dst_dir)) {
            return move_uploaded_file(
                $this->file['tmp_name'],
                $dst_dir . '/' . $dst_filename
            );
        } else {
            throw new SwatException(
                "Destination of '{$dst_dir}' is not a " .
                    'directory or does not exist.'
            );
        }
    }
public function saveFile($dst_dir, $dst_filename = null)
    {
        if (!$this->isUploaded()) {
            return false;
        }

        if ($dst_filename === null) {
            $dst_filename = $this->getUniqueFileName($dst_dir);
        }

        if (is_dir($dst_dir)) {
            return move_uploaded_file(
                $this->file['tmp_name'],
                $dst_dir . '/' . $dst_filename
            );
        } else {
            throw new SwatException(
                "Destination of '{$dst_dir}' is not a " .
                    'directory or does not exist.'
            );
        }
    }
public function saveFile ( $ dst_dir , $ dst_filename = null ) { if ( ! $ this -> isUploaded ( ) ) { return false ; } if ( $ dst_filename === null ) { $ dst_filename = $ this -> getUniqueFileName ( $ dst_dir ) ; } if ( is_dir ( $ dst_dir ) ) { return move_uploaded_file ( $ this -> file [ 'tmp_name' ] , $ dst_dir . '/' . $ dst_filename ) ; } else { throw new SwatException ( "Destination of '{$dst_dir}' is not a " . 'directory or does not exist.' ) ; } }
Saves the uploaded file to the server

@param string $dst_dir the directory on the server to save the uploaded
file in.
@param string $dst_filename an optional filename to save the file under.
If no filename is specified, the file is
saved with the original filename.

@return boolean true if the file was saved correctly and false if there
was an error or no file was uploaded.

@throws SwatException if the destination directory does not exist.
Saves the uploaded file to the server