protected function handleUpload()
    {
        $this->uploadedField = array_keys($_FILES)[0];
        //check if any uploaded file for a defined field
        $this->uploadOk = $this->checkUpload();
        if(!$this->uploadOk) {
            return;
        }
        //exec upload
        $this->uploadOk = $this->uploadFields[$this->uploadedField]->handleUpload($this->uploader);
        if(!$this->uploadOk) {
            return;
        }
        //outputs post processing
        $outputs = $this->uploadFields[$this->uploadedField]->getOutputsFiles();
        foreach($this->uploadFieldsDefinitions[$this->uploadedField]['outputs'] as $output => $outputDefinition) {
            if(isset($outputDefinition['processor'])) {
                $this->{$outputDefinition['processor']}($outputs[$output]['path']);
            }
        }
    }
protected function handleUpload()
    {
        $this->uploadedField = array_keys($_FILES)[0];
        //check if any uploaded file for a defined field
        $this->uploadOk = $this->checkUpload();
        if(!$this->uploadOk) {
            return;
        }
        //exec upload
        $this->uploadOk = $this->uploadFields[$this->uploadedField]->handleUpload($this->uploader);
        if(!$this->uploadOk) {
            return;
        }
        //outputs post processing
        $outputs = $this->uploadFields[$this->uploadedField]->getOutputsFiles();
        foreach($this->uploadFieldsDefinitions[$this->uploadedField]['outputs'] as $output => $outputDefinition) {
            if(isset($outputDefinition['processor'])) {
                $this->{$outputDefinition['processor']}($outputs[$output]['path']);
            }
        }
    }
protected function handleUpload ( ) { $ this -> uploadedField = array_keys ( $ _FILES ) [ 0 ] ; //check if any uploaded file for a defined field $ this -> uploadOk = $ this -> checkUpload ( ) ; if ( ! $ this -> uploadOk ) { return ; } //exec upload $ this -> uploadOk = $ this -> uploadFields [ $ this -> uploadedField ] -> handleUpload ( $ this -> uploader ) ; if ( ! $ this -> uploadOk ) { return ; } //outputs post processing $ outputs = $ this -> uploadFields [ $ this -> uploadedField ] -> getOutputsFiles ( ) ; foreach ( $ this -> uploadFieldsDefinitions [ $ this -> uploadedField ] [ 'outputs' ] as $ output => $ outputDefinition ) { if ( isset ( $ outputDefinition [ 'processor' ] ) ) { $ this -> { $ outputDefinition [ 'processor' ] } ( $ outputs [ $ output ] [ 'path' ] ) ; } } }
Executes the upload action
Executes the upload action