CleanupFormUploadsCommand extends Command
CLI command to clean up old file upload folders created by the TYPO3 Form Framework.
When users upload files via ext:form, the files are stored in form_<hash> sub-folders.
Over time these folders accumulate — both from completed and incomplete form submissions.
Since files are not moved upon submission, there is no way to distinguish between
the two. This command removes form upload folders older than a configurable retention period.
Usage examples:
Dry-run: list form upload folders older than 2 weeks (default)
bin/typo3 form:cleanup:uploads 1:/user_upload/ --dry-run
Delete folders older than 48 hours in specific upload folders
bin/typo3 form:cleanup:uploads 1:/user_upload/ 2:/custom_uploads/ --retention-period=48
Force deletion without confirmation (e.g. for scheduler)
bin/typo3 form:cleanup:uploads 1:/user_upload/ --force
Attributes
- #[AsCommand]
- 'form:cleanup:uploads'
- 'Remove old form file upload folders based on retention period.'
Table of Contents
Methods
- __construct() : mixed
- configure() : void
- execute() : int
Methods
__construct()
public
__construct(CleanupFormUploadsService $cleanupService) : mixed
Parameters
- $cleanupService : CleanupFormUploadsService
configure()
protected
configure() : void
execute()
protected
execute(InputInterface $input, OutputInterface $output) : int
Parameters
- $input : InputInterface
- $output : OutputInterface