public function moveFileFromTmp($name)
    {
        $baseTmpPath = $this->getBaseTmpPath();
        $basePath = $this->getBasePath();

        $baseFilePath = $this->getFilePath($basePath, $name);
        $baseTmpFilePath = $this->getFilePath($baseTmpPath, $name);

        try {
            $this->coreFileStorageDatabase->copyFile(
                $baseTmpFilePath,
                $baseFilePath
            );
            $this->mediaDirectory->renameFile(
                $baseTmpFilePath,
                $baseFilePath
            );
        } catch (\Exception $e) {
            throw new LocalizedException(
                __('Something went wrong while saving the file(s).')
            );
        }

        return $name;
    }
public function moveFileFromTmp($name)
    {
        $baseTmpPath = $this->getBaseTmpPath();
        $basePath = $this->getBasePath();

        $baseFilePath = $this->getFilePath($basePath, $name);
        $baseTmpFilePath = $this->getFilePath($baseTmpPath, $name);

        try {
            $this->coreFileStorageDatabase->copyFile(
                $baseTmpFilePath,
                $baseFilePath
            );
            $this->mediaDirectory->renameFile(
                $baseTmpFilePath,
                $baseFilePath
            );
        } catch (\Exception $e) {
            throw new LocalizedException(
                __('Something went wrong while saving the file(s).')
            );
        }

        return $name;
    }
public function moveFileFromTmp ( $ name ) { $ baseTmpPath = $ this -> getBaseTmpPath ( ) ; $ basePath = $ this -> getBasePath ( ) ; $ baseFilePath = $ this -> getFilePath ( $ basePath , $ name ) ; $ baseTmpFilePath = $ this -> getFilePath ( $ baseTmpPath , $ name ) ; try { $ this -> coreFileStorageDatabase -> copyFile ( $ baseTmpFilePath , $ baseFilePath ) ; $ this -> mediaDirectory -> renameFile ( $ baseTmpFilePath , $ baseFilePath ) ; } catch ( \ Exception $ e ) { throw new LocalizedException ( __ ( 'Something went wrong while saving the file(s).' ) ) ; } return $ name ; }
Checking file for moving and move it

@param string $name

@return string

@throws \Magento\Framework\Exception\LocalizedException
Checking file for moving and move it