src/GuillermoMartinez/Filemanager/Filemanager.php
public function uploadAll($files,$path){
        if( is_array($files) && count($files) > 0 ){
            $n = count($files);
            if( $n <= $this->config['upload']['number'] ){
                $res = array();
                $notresult = array();
                foreach ($files as $key => $value) {
                    $file = $this->upload($value,$path);
                    if( $file ){
                        $this->createThumb($file,$path);
                        $res[] = $file->getFilename();
                    }else{
                        $notresult[] = $value->getClientOriginalName();
                    }
                }
                $r = '';
                $n2 = count($res);
                $result = array("query"=>"BE_UPLOADALL_UPLOADS %s / %s","params"=>array($n2,$n));
                if(count($notresult)>0){
                    $result['query'] = $result['query'].' | BE_UPLOADALL_NOT_UPLOADS ';
                    $i=0;
                    $n = count($notresult);
                    foreach ($notresult as $value) {
                        $result['query'] = $result['query'] . ' %s';
                        if( $n - 1 > $i ){
                            $result['query'] = $result['query'] . ',';
                            $value = $value.',';
                        }
                        $result['params'][] = $value;
                        $i++;

                    }
                    $this->setInfo(array("status"=>0));
                }
                $this->setInfo(array("msg"=>$result));
                return $res;
            }else{
                $result = array("query"=>"BE_UPLOAD_MAX_UPLOAD %s","params"=>array($this->config['upload']['number']));
                $this->setInfo(array("msg"=>$result,"status"=>0));
            }
        }else{
            return ;
        }
    }
public function uploadAll($files,$path){
        if( is_array($files) && count($files) > 0 ){
            $n = count($files);
            if( $n <= $this->config['upload']['number'] ){
                $res = array();
                $notresult = array();
                foreach ($files as $key => $value) {
                    $file = $this->upload($value,$path);
                    if( $file ){
                        $this->createThumb($file,$path);
                        $res[] = $file->getFilename();
                    }else{
                        $notresult[] = $value->getClientOriginalName();
                    }
                }
                $r = '';
                $n2 = count($res);
                $result = array("query"=>"BE_UPLOADALL_UPLOADS %s / %s","params"=>array($n2,$n));
                if(count($notresult)>0){
                    $result['query'] = $result['query'].' | BE_UPLOADALL_NOT_UPLOADS ';
                    $i=0;
                    $n = count($notresult);
                    foreach ($notresult as $value) {
                        $result['query'] = $result['query'] . ' %s';
                        if( $n - 1 > $i ){
                            $result['query'] = $result['query'] . ',';
                            $value = $value.',';
                        }
                        $result['params'][] = $value;
                        $i++;

                    }
                    $this->setInfo(array("status"=>0));
                }
                $this->setInfo(array("msg"=>$result));
                return $res;
            }else{
                $result = array("query"=>"BE_UPLOAD_MAX_UPLOAD %s","params"=>array($this->config['upload']['number']));
                $this->setInfo(array("msg"=>$result,"status"=>0));
            }
        }else{
            return ;
        }
    }
public function uploadAll ( $ files , $ path ) { if ( is_array ( $ files ) && count ( $ files ) > 0 ) { $ n = count ( $ files ) ; if ( $ n <= $ this -> config [ 'upload' ] [ 'number' ] ) { $ res = array ( ) ; $ notresult = array ( ) ; foreach ( $ files as $ key => $ value ) { $ file = $ this -> upload ( $ value , $ path ) ; if ( $ file ) { $ this -> createThumb ( $ file , $ path ) ; $ res [ ] = $ file -> getFilename ( ) ; } else { $ notresult [ ] = $ value -> getClientOriginalName ( ) ; } } $ r = '' ; $ n2 = count ( $ res ) ; $ result = array ( "query" => "BE_UPLOADALL_UPLOADS %s / %s" , "params" => array ( $ n2 , $ n ) ) ; if ( count ( $ notresult ) > 0 ) { $ result [ 'query' ] = $ result [ 'query' ] . ' | BE_UPLOADALL_NOT_UPLOADS ' ; $ i = 0 ; $ n = count ( $ notresult ) ; foreach ( $ notresult as $ value ) { $ result [ 'query' ] = $ result [ 'query' ] . ' %s' ; if ( $ n - 1 > $ i ) { $ result [ 'query' ] = $ result [ 'query' ] . ',' ; $ value = $ value . ',' ; } $ result [ 'params' ] [ ] = $ value ; $ i ++ ; } $ this -> setInfo ( array ( "status" => 0 ) ) ; } $ this -> setInfo ( array ( "msg" => $ result ) ) ; return $ res ; } else { $ result = array ( "query" => "BE_UPLOAD_MAX_UPLOAD %s" , "params" => array ( $ this -> config [ 'upload' ] [ 'number' ] ) ) ; $ this -> setInfo ( array ( "msg" => $ result , "status" => 0 ) ) ; } } else { return ; } }
Upload all files
@param array $files
@param string $path
@return array|null
Upload all files