How to get all files list from folder in typo3


For get list of all file from folder you have to use following script.

If you have three file and five folders in your current folder then it will render only three files.


$folderPath = "fileadmin/images/"

$files = \TYPO3\CMS\Core\Utility\GeneralUtility::getFilesInDir($folderPath, '', true, 1, '');

After print of that result Output will look like below

print_r($files);

Array
(
    [82141013ca93e10552e65da03ea89014] => fileadmin/images/jainish.jpg
    [514f220a8ceb5d13971e6fddf5a06f0c] => fileadmin/images/senjaliya.jpg
    [5ee9823729a422345befd96d2ece6b69] => fileadmin/images/jainish.txt
)

You will get all files list in array.

Note : It will not render folders. its only render list of all files with different extension.

If you have any queries, please do not hesitate to contact me at Jainish Senjaliya

Advertisements

2 thoughts on “How to get all files list from folder in typo3

  1. Pingback: How to get all images from folder in typo3 | Typo3 and PHP Techie Blog

  2. Pingback: How to get all images from folder in typo3 | Typo3 and PHP Techie Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s