public  function start(String $fileName = 'upload', String $rootDir = NULL) : Bool
    {
        $fileName = $this->settings['source'] ?? $fileName;
        $rootDir  = $this->settings['target'] ?? $rootDir ?? $this->uploadDirectory;

        if( ! is_dir($rootDir) ) 
        {
            mkdir($rootDir);
        }

        $extensions = $this->_separator('extensions');
        $mimes      = $this->_separator('mimes');

        $this->file = $fileName;
        $encryption = $this->settings['prefix']      ?? '';
        $name       = $_FILES[$fileName]['name']     ?? NULL;
        $source     = $_FILES[$fileName]['tmp_name'] ?? NULL;
        $root       = Base::suffix($rootDir, '/');     

        if( is_array($name) )
        {
            for( $index = 0; $index < count($name); $index++ )
            {
                $this->_upload($rootDir, $root, $source[$index], $name[$index], $extensions, $mimes, $encryption);
            }

            $return = true;
        }
        else
        {
            $return = $this->_upload($rootDir, $root, $source, $name, $extensions, $mimes, $encryption);
        }

        $this->_default();

        return $return;
    }
public  function start(String $fileName = 'upload', String $rootDir = NULL) : Bool
    {
        $fileName = $this->settings['source'] ?? $fileName;
        $rootDir  = $this->settings['target'] ?? $rootDir ?? $this->uploadDirectory;

        if( ! is_dir($rootDir) ) 
        {
            mkdir($rootDir);
        }

        $extensions = $this->_separator('extensions');
        $mimes      = $this->_separator('mimes');

        $this->file = $fileName;
        $encryption = $this->settings['prefix']      ?? '';
        $name       = $_FILES[$fileName]['name']     ?? NULL;
        $source     = $_FILES[$fileName]['tmp_name'] ?? NULL;
        $root       = Base::suffix($rootDir, '/');     

        if( is_array($name) )
        {
            for( $index = 0; $index < count($name); $index++ )
            {
                $this->_upload($rootDir, $root, $source[$index], $name[$index], $extensions, $mimes, $encryption);
            }

            $return = true;
        }
        else
        {
            $return = $this->_upload($rootDir, $root, $source, $name, $extensions, $mimes, $encryption);
        }

        $this->_default();

        return $return;
    }
public function start ( String $ fileName = 'upload' , String $ rootDir = NULL ) : Bool { $ fileName = $ this -> settings [ 'source' ] ?? $ fileName ; $ rootDir = $ this -> settings [ 'target' ] ?? $ rootDir ?? $ this -> uploadDirectory ; if ( ! is_dir ( $ rootDir ) ) { mkdir ( $ rootDir ) ; } $ extensions = $ this -> _separator ( 'extensions' ) ; $ mimes = $ this -> _separator ( 'mimes' ) ; $ this -> file = $ fileName ; $ encryption = $ this -> settings [ 'prefix' ] ?? '' ; $ name = $ _FILES [ $ fileName ] [ 'name' ] ?? NULL ; $ source = $ _FILES [ $ fileName ] [ 'tmp_name' ] ?? NULL ; $ root = Base :: suffix ( $ rootDir , '/' ) ; if ( is_array ( $ name ) ) { for ( $ index = 0 ; $ index < count ( $ name ) ; $ index ++ ) { $ this -> _upload ( $ rootDir , $ root , $ source [ $ index ] , $ name [ $ index ] , $ extensions , $ mimes , $ encryption ) ; } $ return = true ; } else { $ return = $ this -> _upload ( $ rootDir , $ root , $ source , $ name , $ extensions , $ mimes , $ encryption ) ; } $ this -> _default ( ) ; return $ return ; }
Start file upload

@param string $fileName = 'upload'
@param string $rootDir  = NULL

@return bool
Start file upload