[TYPO3-dev] read elements from sysFolder

typo3dev typo3 at mielec.info
Wed Nov 25 11:21:15 CET 2015


On 25.11.2015 09:23, Jigal van Hemert wrote:
> Hi,
>
> On 25/11/2015 07:56, typo3 wrote:
>> after long research i have to ask :-(
>>
>> how can i access any elements from directory from BE via php in
>> extension?
>>
>> i need to read image elements, tried with FAL but if i dont know file
>> name i cant get data
>
> Not tested, but I would try it with:
>
> $path = 'path/to/the/directory/';
> $resourceFactory =
> GeneralUtility::makeInstance(TYPO3\CMS\Core\Resource\ResourceFactory::class);
>
> $folder = $resourceFactory->retrieveFileOrFolderObject($path);
> $files = $folder->getFiles($start = 0, $numberOfItems = 0, $filterMode =
> self::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS, $recursive = false, $sort
> = '', $sortRev = false);
>
> Then you have an array of file objects and I assume that you can get the
> data you want from the files.
>
> You can get a lot of inspiration from the filelist sysext.
>

thx for quick answer, currently im still digging int sysext

i'll check this example :-) quickly copy&paste doesnt work :-D
but to be sure ill write again
i have "directory" Folder on tree in BE and i store there page conten images
and trying to read it out

so currently im reading direct via sql and then when i have file id i 
can work but currrently i dont have any idea where to start search on
sysext

any tip what is responsible for objects on backend?

-- 
Andy



More information about the TYPO3-dev mailing list