[TYPO3-mvc] Confusion with filesize() path

g4-lisz at tonarchiv.ch g4-lisz at tonarchiv.ch
Wed Apr 11 16:08:28 CEST 2012


On 04/11/2012 03:32 PM, Sebastian Schreiber wrote:
> This question is not really related to extbase or fluid.
>
> It is always good practice to make the path absolute in this case.
> Call this in your viewhelper and you should be fine:
>
> $absPathToFile = 
> t3lib_div::getFileAbsFileName('uploads/tx_myext/pdf/XXX.pdf');
> if(is_file($absPathToFile)) {
>   return filesize($absPathToFile);
> }
> return NULL;
>
> Should work in Backend and Frontend.
Thanks a lot, t3lib_div::getFileAbsFileName() did the trick...

Cheers,
Till



More information about the TYPO3-project-typo3v4mvc mailing list