---
title: "Breaking: #97214 - Use UploadedFile objects instead of $_FILES"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:breaking-97214"
source: "Changelog/12.0/Breaking-97214-UseUploadedFileObjectsInsteadOf_FILES.rst"
typo3-version: "12.0"
typo3-major: 12
type: "breaking"
issue: 97214
forge: "https://forge.typo3.org/issues/97214"
tags: ["PHP-API", "NotScanned", "ext:extbase"]
rendered: "2026-09-17T21:17:42+00:00"
---

# Breaking: #97214 - Use UploadedFile objects instead of $\_FILES {#breaking-97214-use-uploadedfile-objects-instead-of-files}

See [forge#97214](https://forge.typo3.org/issues/97214)

## Description {#description}

The TYPO3 request already contains a "disentangled" array of UploadedFile
objects. With this change, these UploadedFile objects are now used instead
of the superglobal `$_FILES` in Extbase requests.

Additionally, the FAL ResourceStorage has been adjusted for handling
UploadedFile objects and the ExtensionManager upload handling has been
adjusted.

The next step would be to further adjust FAL to use only PSR provided
methods for handling uploaded files and implementing an API for file
uploads in Extbase.

## Impact {#impact}

The global `$_FILES` object is not used in Extbase or the extension
manager anymore, instead the PSR request is used.

## Affected Installations {#affected-installations}

All installations extending the TYPO3 Core ResourceStorage object and
overwriting the `addUploadedFile` method.

## Migration {#migration}

Extension authors extending the TYPO3 Core resource storage and implementing
their own handling of `addUploadedFile` need to allow objects of type
`UploadedFile` in addition to the old array from global `$_FILES`.

To do so, switch the type annotation to `array|UploadedFile` and add code that
handles `UploadedFile` objects and arrays.

### Example {#example}

```php
if ($uploadedFileData instanceof UploadedFile) {
    $localFilePath = $uploadedFileData->getTemporaryFileName();
    if ($targetFileName === null) {
        $targetFileName = $uploadedFileData->getClientFilename();
    }
    $size = $uploadedFileData->getSize();
} else {
    $localFilePath = $uploadedFileData['tmp_name'];
    if ($targetFileName === null) {
        $targetFileName = $uploadedFileData['name'];
    }
    $size = $uploadedFileData['size'];
}
```
