[TYPO3-english] got cObj->IMAGE in backend to work, but ...

Bjoern Pedersen bjoern.pedersen at frm2.tum.de
Mon Jan 17 17:01:18 CET 2011


Am 17.01.2011 16:47, schrieb Thomas Appel:

> The problem is, that, in my case, the conversion fails in class tslib_cObj at about line 5520:
> 							$GLOBALS['TSFE']->tmpl->fileCache[$hash]['origFile'] = $theImage;
> 							$GLOBALS['TSFE']->tmpl->fileCache[$hash]['origFile_mtime'] = @filemtime($theImage);
> 
> I can call my script from a "real" FE session an it works. debug($theImage) prints out the relative path to the image file ('uploads/pluginfolder/image.jpg') but gets validated in filemtime($theImage) (but why?).
> Called from the backend $theImage prints put the same string (relative path) but filemtime($theImage) fails (which seems to me the more logical case). 
                                                                ^^^^here
That is your problem: FE runs from your website root, BE scripts run
from root/typo3, so the relative path is wrong. There are API-functions
to resolve the path, please check the docs.

Björn


More information about the TYPO3-english mailing list