public function commitFile(ElementFile $file)
    {
        $filename = $file->path;

        $currentname = Media::getPathFromContent($file);
        File::resolveFilepath($currentname, null, array('base_dir' => $this->_mediadir));

        try {
            if (!is_dir(dirname($currentname))) {
                mkdir(dirname($currentname), 0755, true);
            }
            File::move($filename, $currentname);
            $file->path = Media::getPathFromContent($file);
            $this->dispatchPostUploadEvent($currentname, $file->path);
        } catch (\BackBee\Exception\BBException $e) {
            return false;
        }

        return true;
    }
public function commitFile(ElementFile $file)
    {
        $filename = $file->path;

        $currentname = Media::getPathFromContent($file);
        File::resolveFilepath($currentname, null, array('base_dir' => $this->_mediadir));

        try {
            if (!is_dir(dirname($currentname))) {
                mkdir(dirname($currentname), 0755, true);
            }
            File::move($filename, $currentname);
            $file->path = Media::getPathFromContent($file);
            $this->dispatchPostUploadEvent($currentname, $file->path);
        } catch (\BackBee\Exception\BBException $e) {
            return false;
        }

        return true;
    }
public function commitFile ( ElementFile $ file ) { $ filename = $ file -> path ; $ currentname = Media :: getPathFromContent ( $ file ) ; File :: resolveFilepath ( $ currentname , null , array ( 'base_dir' => $ this -> _mediadir ) ) ; try { if ( ! is_dir ( dirname ( $ currentname ) ) ) { mkdir ( dirname ( $ currentname ) , 0755 , true ) ; } File :: move ( $ filename , $ currentname ) ; $ file -> path = Media :: getPathFromContent ( $ file ) ; $ this -> dispatchPostUploadEvent ( $ currentname , $ file -> path ) ; } catch ( \ BackBee \ Exception \ BBException $ e ) { return false ; } return true ; }
Move an temporary uploaded file to either media library or storage directory.

@param \BackBee\ClassContent\Element\File $file

@return boolean
Move an temporary uploaded file to either media library or storage directory .