public function moveTo($to, $filename = null)
    {
        if (!isset($this->file['tmp_name'])) {
            return false;
        }

        if (!is_null($filename)) {
            $filename = $this->getHashName();
        }

        if (!is_dir($to)) {
            @mkdir($to, 0777, true);
        }

        $resolve = rtrim($to, '/').'/'.$filename;

        return (bool) move_uploaded_file($this->file['tmp_name'], $resolve);
    }
public function moveTo($to, $filename = null)
    {
        if (!isset($this->file['tmp_name'])) {
            return false;
        }

        if (!is_null($filename)) {
            $filename = $this->getHashName();
        }

        if (!is_dir($to)) {
            @mkdir($to, 0777, true);
        }

        $resolve = rtrim($to, '/').'/'.$filename;

        return (bool) move_uploaded_file($this->file['tmp_name'], $resolve);
    }
public function moveTo ( $ to , $ filename = null ) { if ( ! isset ( $ this -> file [ 'tmp_name' ] ) ) { return false ; } if ( ! is_null ( $ filename ) ) { $ filename = $ this -> getHashName ( ) ; } if ( ! is_dir ( $ to ) ) { @ mkdir ( $ to , 0777 , true ) ; } $ resolve = rtrim ( $ to , '/' ) . '/' . $ filename ; return ( bool ) move_uploaded_file ( $ this -> file [ 'tmp_name' ] , $ resolve ) ; }
Move the uploader file to a directory.

@param  string $to
@param  string|null $filename
@return bool
@throws
Move the uploader file to a directory .