concrete/controllers/backend/file.php
protected function getDestinationFolder()
    {
        if ($this->destinationFolder === false) {
            $replacingFile = $this->getFileToBeReplaced();
            if ($replacingFile !== null) {
                $folder = $replacingFile->getFileFolderObject();
            } else {
                $treeNodeID = $this->request->request->get('currentFolder');
                if ($treeNodeID) {
                    $treeNodeID = is_scalar($treeNodeID) ? (int) $treeNodeID : 0;
                    $folder = $treeNodeID === 0 ? null : Node::getByID($treeNodeID);
                } else {
                    $filesystem = new Filesystem();
                    $folder = $filesystem->getRootFolder();
                }
            }
            if (!$folder instanceof FileFolder) {
                throw new UserMessageException(t('Unable to find the specified folder.'));
            }
            if ($replacingFile === null) {
                $fp = new Checker($folder);
                if (!$fp->canAddFiles()) {
                    throw new UserMessageException(t('Unable to add files.'), 400);
                }
            }
            $this->destinationFolder = $folder;
        }

        return $this->destinationFolder;
    }
protected function getDestinationFolder()
    {
        if ($this->destinationFolder === false) {
            $replacingFile = $this->getFileToBeReplaced();
            if ($replacingFile !== null) {
                $folder = $replacingFile->getFileFolderObject();
            } else {
                $treeNodeID = $this->request->request->get('currentFolder');
                if ($treeNodeID) {
                    $treeNodeID = is_scalar($treeNodeID) ? (int) $treeNodeID : 0;
                    $folder = $treeNodeID === 0 ? null : Node::getByID($treeNodeID);
                } else {
                    $filesystem = new Filesystem();
                    $folder = $filesystem->getRootFolder();
                }
            }
            if (!$folder instanceof FileFolder) {
                throw new UserMessageException(t('Unable to find the specified folder.'));
            }
            if ($replacingFile === null) {
                $fp = new Checker($folder);
                if (!$fp->canAddFiles()) {
                    throw new UserMessageException(t('Unable to add files.'), 400);
                }
            }
            $this->destinationFolder = $folder;
        }

        return $this->destinationFolder;
    }
protected function getDestinationFolder ( ) { if ( $ this -> destinationFolder === false ) { $ replacingFile = $ this -> getFileToBeReplaced ( ) ; if ( $ replacingFile !== null ) { $ folder = $ replacingFile -> getFileFolderObject ( ) ; } else { $ treeNodeID = $ this -> request -> request -> get ( 'currentFolder' ) ; if ( $ treeNodeID ) { $ treeNodeID = is_scalar ( $ treeNodeID ) ? ( int ) $ treeNodeID : 0 ; $ folder = $ treeNodeID === 0 ? null : Node :: getByID ( $ treeNodeID ) ; } else { $ filesystem = new Filesystem ( ) ; $ folder = $ filesystem -> getRootFolder ( ) ; } } if ( ! $ folder instanceof FileFolder ) { throw new UserMessageException ( t ( 'Unable to find the specified folder.' ) ) ; } if ( $ replacingFile === null ) { $ fp = new Checker ( $ folder ) ; if ( ! $ fp -> canAddFiles ( ) ) { throw new UserMessageException ( t ( 'Unable to add files.' ) , 400 ) ; } } $ this -> destinationFolder = $ folder ; } return $ this -> destinationFolder ; }
Get the destination folder where the uploaded files should be placed.

@throws \Concrete\Core\Error\UserMessageException in case the folder couldn't be found or it's not accessible

@return \Concrete\Core\Tree\Node\Type\FileFolder

@since 8.5.0a3
Get the destination folder where the uploaded files should be placed .