---
title: "DeleteUploads finishers"
manual: "Form"
version: "main"
permalink: "https://docs.typo3.org/permalink/typo3/cms-form:finishers-delete-uploads@main"
source: "I/Concepts/Finishers/ReadyToUseFinishers/DeleteUploadsFinisher/Index.rst"
rendered: "2026-09-19T16:47:20+00:00"
---

# DeleteUploads finishers {#finishers-delete-uploads}

The "DeleteUploads finisher" removes files that have been submitted. You can use this
finisher after the email finisher if you do not want to keep the files
in your TYPO3 installation.

> [!NOTE]
> Finishers are only executed when a form is successfully submitted. If a user uploads
> a file but does not finish filling out the form, the uploaded files will not
> be deleted.

**Table of contents**

-   [DeleteUploads finisher in the YAML form definition](https://docs.typo3.org/permalink/typo3/cms-form:deleteuploads-finisher-in-the-yaml-form-definition@main)
-   [Using the DeleteUploads finisher in PHP code](https://docs.typo3.org/permalink/typo3/cms-form:using-the-deleteuploads-finisher-in-php-code@main)

> [!IMPORTANT]
> Finishers are executed in the order defined in your form definition.
>
> See [Finisher execution order](https://docs.typo3.org/permalink/typo3/cms-form:concepts-finishers-execution-order@main).

## DeleteUploads finisher in the YAML form definition {#concepts-finishers-deleteuploadsfinisher-yaml}

Use this finisher after the email finisher if you do not want to keep the files
in your TYPO3 installation.

Finishers are executed in the order they are listed in the form definition
YAML file:

**public/fileadmin/forms/my_form.yaml**

```yaml
identifier: example-form
label: 'example'
type: Form

finishers:
  -
    identifier: EmailToSender
    options:
      subject: 'Your Message: {message}'
  -
    identifier: DeleteUploads
    # Define the delete uploads finisher AFTER the email finisher
# ...

```

## Using the DeleteUploads finisher in PHP code {#apireference-finisheroptions-deleteuploadsfinisher}

Developers can use the finisher key `DeleteUploads` to create
deleteuploads finishers in their own classes:

```php
<?php

use TYPO3\CMS\Form\Domain\Model\FormDefinition;

class SomeClass
{
    private function addDeleteUploadsFinisherWithMessage(FormDefinition $formDefinition, string $message)
    {
        $formDefinition->createFinisher('DeleteUploads');
    }
}

```

This finisher is implemented in `\TYPO3\CMS\Form\Domain\Finishers\DeleteUploadsFinisher`.
