src/Teamsisu/MetaModelsFrontendInput/Handler/Save/UploadSaveHandler.php
public function parseWidget($widget)
    {

        /**
         * Check if file in session exists
         */
        if(!isset($_SESSION['FILES'][$this->field->getColName()])){
            return false;
        }

        /**
         * Rename the file (move) to the new location with the new name
         */
        $ext = pathinfo($_SESSION['FILES'][$this->field->getColName()]['name'], PATHINFO_EXTENSION);
        $name = $this->field->uploadPath . '/' . $this->item->get('id') . '_' . $this->field->getColName() . '.' . $ext;

        if (move_uploaded_file($_SESSION['FILES'][$this->field->getColName()]['tmp_name'], TL_ROOT . '/' . $name)) {

            /**
             * Add File to the DBAFS
             */
            $dbafsFile = \Dbafs::addResource($name);

            /**
             * Remove file from session
             */
            unset($_SESSION['FILES'][$this->field->getColName()]);

            /**
             * Return UUID
             */

            return $dbafsFile->uuid;

        }

        return false;

    }
public function parseWidget($widget)
    {

        /**
         * Check if file in session exists
         */
        if(!isset($_SESSION['FILES'][$this->field->getColName()])){
            return false;
        }

        /**
         * Rename the file (move) to the new location with the new name
         */
        $ext = pathinfo($_SESSION['FILES'][$this->field->getColName()]['name'], PATHINFO_EXTENSION);
        $name = $this->field->uploadPath . '/' . $this->item->get('id') . '_' . $this->field->getColName() . '.' . $ext;

        if (move_uploaded_file($_SESSION['FILES'][$this->field->getColName()]['tmp_name'], TL_ROOT . '/' . $name)) {

            /**
             * Add File to the DBAFS
             */
            $dbafsFile = \Dbafs::addResource($name);

            /**
             * Remove file from session
             */
            unset($_SESSION['FILES'][$this->field->getColName()]);

            /**
             * Return UUID
             */

            return $dbafsFile->uuid;

        }

        return false;

    }
public function parseWidget ( $ widget ) { /**
         * Check if file in session exists
         */ if ( ! isset ( $ _SESSION [ 'FILES' ] [ $ this -> field -> getColName ( ) ] ) ) { return false ; } /**
         * Rename the file (move) to the new location with the new name
         */ $ ext = pathinfo ( $ _SESSION [ 'FILES' ] [ $ this -> field -> getColName ( ) ] [ 'name' ] , PATHINFO_EXTENSION ) ; $ name = $ this -> field -> uploadPath . '/' . $ this -> item -> get ( 'id' ) . '_' . $ this -> field -> getColName ( ) . '.' . $ ext ; if ( move_uploaded_file ( $ _SESSION [ 'FILES' ] [ $ this -> field -> getColName ( ) ] [ 'tmp_name' ] , TL_ROOT . '/' . $ name ) ) { /**
             * Add File to the DBAFS
             */ $ dbafsFile = \ Dbafs :: addResource ( $ name ) ; /**
             * Remove file from session
             */ unset ( $ _SESSION [ 'FILES' ] [ $ this -> field -> getColName ( ) ] ) ; /**
             * Return UUID
             */ return $ dbafsFile -> uuid ; } return false ; }
Parses the widget and returns either the uuid of the file or false if moving the file failed

@param $widget
@return mixed
@throws \Exception
Parses the widget and returns either the uuid of the file or false if moving the file failed