source/Core/UtilsFile.php
public function processFile($sFileName, $sUploadPath)
    {
        $aFileInfo = $_FILES[$sFileName];

        $sBasePath = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sShopDir');

        //checking params
        if (!isset($aFileInfo['name']) || !isset($aFileInfo['tmp_name'])) {
            throw oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class, 'EXCEPTION_NOFILE');
        }

        //wrong chars in file name?
        if (!getStr()->preg_match('/^[\-_a-z0-9\.]+$/i', $aFileInfo['name'])) {
            throw oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class, 'EXCEPTION_FILENAMEINVALIDCHARS');
        }

        // error uploading file ?
        if (isset($aFileInfo['error']) && $aFileInfo['error']) {
            throw oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class, 'EXCEPTION_FILEUPLOADERROR_' . ((int) $aFileInfo['error']));
        }

        $aPathInfo = pathinfo($aFileInfo['name']);

        $sExt = $aPathInfo['extension'];
        $sFileName = $aPathInfo['filename'];

        $aAllowedUploadTypes = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aAllowedUploadTypes');
        $aAllowedUploadTypes = array_map("strtolower", $aAllowedUploadTypes);

        if (!in_array(strtolower($sExt), $aAllowedUploadTypes)) {
            throw oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class, 'EXCEPTION_NOTALLOWEDTYPE');
        }

        $sFileName = $this->_getUniqueFileName($sBasePath . $sUploadPath, $sFileName, $sExt);

        if ($this->_moveImage($aFileInfo['tmp_name'], $sBasePath . $sUploadPath . "/" . $sFileName)) {
            return $sFileName;
        }

        return false;
    }
public function processFile($sFileName, $sUploadPath)
    {
        $aFileInfo = $_FILES[$sFileName];

        $sBasePath = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sShopDir');

        //checking params
        if (!isset($aFileInfo['name']) || !isset($aFileInfo['tmp_name'])) {
            throw oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class, 'EXCEPTION_NOFILE');
        }

        //wrong chars in file name?
        if (!getStr()->preg_match('/^[\-_a-z0-9\.]+$/i', $aFileInfo['name'])) {
            throw oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class, 'EXCEPTION_FILENAMEINVALIDCHARS');
        }

        // error uploading file ?
        if (isset($aFileInfo['error']) && $aFileInfo['error']) {
            throw oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class, 'EXCEPTION_FILEUPLOADERROR_' . ((int) $aFileInfo['error']));
        }

        $aPathInfo = pathinfo($aFileInfo['name']);

        $sExt = $aPathInfo['extension'];
        $sFileName = $aPathInfo['filename'];

        $aAllowedUploadTypes = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aAllowedUploadTypes');
        $aAllowedUploadTypes = array_map("strtolower", $aAllowedUploadTypes);

        if (!in_array(strtolower($sExt), $aAllowedUploadTypes)) {
            throw oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class, 'EXCEPTION_NOTALLOWEDTYPE');
        }

        $sFileName = $this->_getUniqueFileName($sBasePath . $sUploadPath, $sFileName, $sExt);

        if ($this->_moveImage($aFileInfo['tmp_name'], $sBasePath . $sUploadPath . "/" . $sFileName)) {
            return $sFileName;
        }

        return false;
    }
public function processFile ( $ sFileName , $ sUploadPath ) { $ aFileInfo = $ _FILES [ $ sFileName ] ; $ sBasePath = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'sShopDir' ) ; //checking params if ( ! isset ( $ aFileInfo [ 'name' ] ) || ! isset ( $ aFileInfo [ 'tmp_name' ] ) ) { throw oxNew ( \ OxidEsales \ Eshop \ Core \ Exception \ StandardException :: class , 'EXCEPTION_NOFILE' ) ; } //wrong chars in file name? if ( ! getStr ( ) -> preg_match ( '/^[\-_a-z0-9\.]+$/i' , $ aFileInfo [ 'name' ] ) ) { throw oxNew ( \ OxidEsales \ Eshop \ Core \ Exception \ StandardException :: class , 'EXCEPTION_FILENAMEINVALIDCHARS' ) ; } // error uploading file ? if ( isset ( $ aFileInfo [ 'error' ] ) && $ aFileInfo [ 'error' ] ) { throw oxNew ( \ OxidEsales \ Eshop \ Core \ Exception \ StandardException :: class , 'EXCEPTION_FILEUPLOADERROR_' . ( ( int ) $ aFileInfo [ 'error' ] ) ) ; } $ aPathInfo = pathinfo ( $ aFileInfo [ 'name' ] ) ; $ sExt = $ aPathInfo [ 'extension' ] ; $ sFileName = $ aPathInfo [ 'filename' ] ; $ aAllowedUploadTypes = ( array ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'aAllowedUploadTypes' ) ; $ aAllowedUploadTypes = array_map ( "strtolower" , $ aAllowedUploadTypes ) ; if ( ! in_array ( strtolower ( $ sExt ) , $ aAllowedUploadTypes ) ) { throw oxNew ( \ OxidEsales \ Eshop \ Core \ Exception \ StandardException :: class , 'EXCEPTION_NOTALLOWEDTYPE' ) ; } $ sFileName = $ this -> _getUniqueFileName ( $ sBasePath . $ sUploadPath , $ sFileName , $ sExt ) ; if ( $ this -> _moveImage ( $ aFileInfo [ 'tmp_name' ] , $ sBasePath . $ sUploadPath . "/" . $ sFileName ) ) { return $ sFileName ; } return false ; }
Process uploaded files. Returns unique file name, on fail false

@param string $sFileName   form file item name
@param string $sUploadPath RELATIVE (to config sShopDir parameter) path for uploaded file to be copied

@throws oxException if file is not valid

@return string
Process uploaded files . Returns unique file name on fail false