---
title: "TCA definition"
manual: "TYPO3 Explained"
version: "12.4"
permalink: "https://docs.typo3.org/permalink/t3coreapi:fal-using-fal-tca@12.4"
source: "ApiOverview/Fal/UsingFal/Tca.rst"
rendered: "2026-10-21T15:29:37+00:00"
---

> [!WARNING]
> **Attention**
>
> TYPO3 v12 has reached end-of-life as of April 30th 2026 and
> is no longer being maintained. Use the version switcher on the top
> left of this page to select documentation for a supported version of TYPO3.
>
> Need more time before upgrading?
> You can purchase Extended Long Term Support (ELTS) for TYPO3 v12 here:
> [TYPO3 ELTS](https://typo3.com/services/extended-support-elts).

# TCA definition {#fal-using-fal-tca}

This chapter explains how to create a field that makes it possible to
create relations to files.

<!-- TODO: no Markdown rendering for "versionchanged" -->

For TYPO3 v11 and below the API function
ExtensionManagementUtility::getFileFieldTCAConfig() was used to
create a TCA configuration suitable to handle files. This function has been
deprecated with the introduction of the new field type File.
See the Migration section on how to
adjust the configuration.

The TCA field type [File](https://docs.typo3.org/m/typo3/reference-tca/12.4/en-us/ColumnsConfig/Type/File/Index.html#columns-file) can be used to provide a field
in which files can be referenced and/or uploaded:

**EXT:my_extension/Configuration/TCA/my_table.php**

```php
<?php

return [
    'ctrl' => [
        // ...
    ],
    'columns' => [
        'my_media_file' => [
            'label' => 'My image',
            'config' => [
                'type' => 'file',
                'allowed' => 'common-media-types',
            ],
        ],
        // ...
    ],
    // ...
];

```

On the database side, the corresponding field needs to store an integer,
as is usual for relations field:

**EXT:my_extension/ext_tables.sql**

```sql
CREATE TABLE my_table (
  my_media_file int(11) unsigned DEFAULT '0' NOT NULL,
);

```

The property [appearance](https://docs.typo3.org/m/typo3/reference-tca/12.4/en-us/ColumnsConfig/Type/File/Index.html#columns-file-properties-appearance) can be
used to specify, if a file upload button and file by URL button (Vimeo, Youtube)
should be displayed.

Example:

**EXT:my_extension/Configuration/TCA/Overrides/my_table.php**

```php
<?php

$GLOBALS['TCA']['my_table']['columns']['my_media_file']['config']['appearance'] = [
    'fileUploadAllowed' => false,
    'fileByUrlAllowed' => false,
];

```

This will suppress two buttons for upload and external URL and only leave
the button **Create new relation**.

## Migration from `ExtensionManagementUtility::getFileFieldTCAConfig` {#migration-from-php-extensionmanagementutility-getfilefieldtcaconfig}

```php
// Before
'columns' => [
    'image' => [
        'label' => 'My image',
        'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
            'image',
            [
                'maxitems' => 6,
            ],
            $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
        ),
    ],
],

// After
'columns' => [
    'image' => [
        'label' => 'My image',
        'config' => [
            'type' => 'file',
            'maxitems' => 6,
            'allowed' => 'common-image-types'
        ],
    ],
],
```
