Review main Merged

93093[FEATURE] Add cleanup command for form file upload folders

Josua Vogel CR +2 V +2 Hard +772 −0 updated 03/11/26, 08:28

Commit message

When users upload files via ext:form FileUpload or ImageUpload
elements, the files are stored in `form_<hash>` sub-folders inside
the configured upload directory. Over time these folders accumulate
— both from completed and incomplete form submissions.

Since uploaded files are not moved upon form submission, there is
no way to distinguish between folders from completed and abandoned
submissions. This patch introduces a new CLI command
`form:cleanup:uploads` that removes form upload folders older than
a configurable retention period (default: 2 weeks).

Key features:
- Identifies form upload folders by their exact naming pattern
  (`form_` + 40 hex characters as generated by
  UploadedFileReferenceConverter::importUploadedResource())
- Uses folder modification time to determine which folders to remove
- Requires explicit upload folder path(s) as argument to avoid
  scanning all FAL storages, since each form element can configure
  a different saveToFileMount
- Provides --dry-run mode for safe preview before deletion
- Automatically available as TYPO3 Scheduler task
- Includes --force flag; non-interactive mode (scheduler) skips
  confirmation automatically

New components:
- CleanupFormUploadsService: core logic for finding and deleting
  expired folders, separated for testability and reusability
- CleanupFormUploadsCommand: thin CLI command layer with user
  interaction and output formatting

Review

  • Code review CR +2 Done
    • Anja Leichsenring +2
    • Josef Glatz +1
    • Georg Ringer +1
    • Sven Liebert +1
  • Verified V +2 Done
    • Anja Leichsenring +2
    • Josef Glatz +1
    • Georg Ringer +1
    • Sven Liebert +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 2436

Show 611 earlier messages
  1. Josua Vogel uploaded patch set 1 03/05/26, 19:39

  2. Josua Vogel marked it work in progress 03/05/26, 19:40

  3. Josua Vogel uploaded patch set 2 03/05/26, 19:43

  4. core-ci voted on patch set 1 V -1 03/05/26, 19:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97434

  5. core-ci voted on patch set 2 V -1 03/05/26, 19:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97435

  6. Josua Vogel uploaded patch set 3 V -1 03/05/26, 20:27

  7. core-ci voted on patch set 3 V -1 03/05/26, 20:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97436

  8. Josua Vogel uploaded patch set 4 V -1 03/05/26, 20:46

  9. core-ci voted on patch set 4 V -1 03/05/26, 20:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97437

  10. Josua Vogel uploaded patch set 5 V -1 03/05/26, 20:58

  11. core-ci voted on patch set 5 V +1 03/05/26, 21:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97439

  1. Josua Vogel commented on patch set 6 V +1 03/05/26, 21:38

    Published edit on patch set 5.
  2. Josua Vogel commented on patch set 7 03/05/26, 21:43

    Published edit on patch set 6.
  3. core-ci voted on patch set 6 V +1 03/05/26, 21:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97444

  4. Josua Vogel marked it ready for review 03/05/26, 21:54

  5. core-ci voted on patch set 7 V +1 03/05/26, 21:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97445

  6. Simon Schaufelberger commented on patch set 7 03/06/26, 00:29

    CleanupFormUploadsService.php:43

    That is deprecated. Inject the logger interface in the constructor instead
  7. Josua Vogel uploaded patch set 8 V +1 03/06/26, 06:20

  8. core-ci voted on patch set 8 V -1 03/06/26, 06:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97465

  9. Josua Vogel uploaded patch set 9 V -1 03/06/26, 06:34

  10. Josua Vogel commented on patch set 9 03/06/26, 06:40

    CleanupFormUploadsService.php:43 Reply

    Done
  11. core-ci voted on patch set 9 V +1 03/06/26, 06:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97466

  12. Josua Vogel marked it work in progress 03/06/26, 08:07

  13. Josua Vogel uploaded patch set 10 V +1 03/06/26, 13:49

  14. Josua Vogel marked it ready for review 03/06/26, 13:49

  15. core-ci voted on patch set 10 V +1 03/06/26, 14:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97510

  16. Georg Ringer voted on patch set 10 CR +1 V +1 03/10/26, 04:03

  17. Josef Glatz rebased onto patch set 11 CR +1 V +1 03/11/26, 05:05

  18. Josef Glatz uploaded patch set 12 03/11/26, 05:07

  19. Josef Glatz commented on patch set 12 CR +1 V +1 03/11/26, 05:12

    👌 Super handy feature and really a must have in terms of gdpr I've added some linefeeds to the help text area to make it easier to read. [Preview of Patchset 11 changes](https://forge.typo3.org/attachments/download/40429/clipboard-202603110608-pilv2.png)
  20. core-ci voted on patch set 11 V +1 03/11/26, 05:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97737

  21. core-ci voted on patch set 12 V +1 03/11/26, 05:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97738

  22. Georg Ringer voted on patch set 12 CR +1 V +1 03/11/26, 06:57

  23. Sven Liebert voted on patch set 12 CR +1 V +1 03/11/26, 07:16

  24. Anja Leichsenring voted on patch set 12 CR +2 V +2 03/11/26, 08:28

  25. Anja Leichsenring merged patch set 13 03/11/26, 08:28