Attention

TYPO3 v8 has reached its end-of-life March 31st, 2020 and is not maintained by the community anymore. Looking for a stable version? Use the version switch on the top left.

There is no further ELTS support. It is recommended that you upgrade your project and use a supported version of TYPO3.

FILE

This object returns the content of the file specified in the property "file".

It is defined as PHP function fileResource() in typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php.

Note: Do not mix this up with the cObject FILES; both are different cObjects.

Property

file

Data type

resource /stdWrap

Description

The file whose content should be returned.

If the resource is jpg, jpeg, gif or png the image is inserted as an image-tag. All other formats are read and inserted into the HTML code.

The maximum filesize of documents to be read is set to 1024 KB internally!

Property

linkWrap

Data type

linkWrap /stdWrap

Description

(Executed before ".wrap" and ".stdWrap".)

Property

wrap

Data type

wrap /stdWrap

Description

(Executed after ".linkWrap" and before ".stdWrap".)

Property

stdWrap

Data type

->stdWrap

Description

(Executed after ".linkWrap" and ".wrap".)

Property

altText

titleText

Data type

string /stdWrap

Description

For <img> output only!

If no alttext is specified, it will use an empty alttext.

Property

emptyTitleHandling

Data type

string /stdWrap

Description

Value can be "keepEmpty" to preserve an empty title attribute, or "useAlt" to use the alt attribute instead.

Default

useAlt

Property

longdescURL

Data type

string /stdWrap

Description

For <img> output only!

"longdesc" attribute (URL pointing to document with extensive details about image).

[tsref:(cObject).FILE]

Example:

In this example a page is defined, but the content between the body- tags comes directly from the file "gs.html":

page = PAGE
page.typeNum = 0
page.10 = FILE
page.10.file = fileadmin/gs/gs.html