src/FormUploadPreview.php
public function validate()
    {
        // Delete the file when requested
        if (true === $this->enableReset && $this->getPost($this->strName.'_reset')) {
            if (null !== ($fileModel = FilesModel::findByPk($this->varValue))) {
                $file = new File($fileModel->path);
                $file->delete();
            }

            unset($_FILES[$this->strName]);

            return;
        }

        // Handle file upload
        parent::validate();

        // Set the image as varValue
        $file = $_SESSION['FILES'][$this->strName];
        if (true === $file['uploaded']) {
            $this->varValue = StringUtil::uuidToBin($file['uuid']);
        } else {
            $this->blnSubmitInput = false;
        }
    }
public function validate()
    {
        // Delete the file when requested
        if (true === $this->enableReset && $this->getPost($this->strName.'_reset')) {
            if (null !== ($fileModel = FilesModel::findByPk($this->varValue))) {
                $file = new File($fileModel->path);
                $file->delete();
            }

            unset($_FILES[$this->strName]);

            return;
        }

        // Handle file upload
        parent::validate();

        // Set the image as varValue
        $file = $_SESSION['FILES'][$this->strName];
        if (true === $file['uploaded']) {
            $this->varValue = StringUtil::uuidToBin($file['uuid']);
        } else {
            $this->blnSubmitInput = false;
        }
    }
public function validate ( ) { // Delete the file when requested if ( true === $ this -> enableReset && $ this -> getPost ( $ this -> strName . '_reset' ) ) { if ( null !== ( $ fileModel = FilesModel :: findByPk ( $ this -> varValue ) ) ) { $ file = new File ( $ fileModel -> path ) ; $ file -> delete ( ) ; } unset ( $ _FILES [ $ this -> strName ] ) ; return ; } // Handle file upload parent :: validate ( ) ; // Set the image as varValue $ file = $ _SESSION [ 'FILES' ] [ $ this -> strName ] ; if ( true === $ file [ 'uploaded' ] ) { $ this -> varValue = StringUtil :: uuidToBin ( $ file [ 'uuid' ] ) ; } else { $ this -> blnSubmitInput = false ; } }
Validate the user input and set the value.

@throws \Exception
Validate the user input and set the value .