System Config File Cleanup for Magento 2
aimanecouissi/module-system-config-file-cleanup
Deletes previously uploaded media files when a Stores → Configuration file field is saved with a replacement or emptied, preventing orphaned files from accumulating in media storage.
Build Tests
Code Quality
Tested on Magento 2.4.9
Recent Test History
Each release is tested against the latest Magento version at that time.
Top Contributors
View LeaderboardShare This Module's Status
README
Loaded from GitHubAimaneCouissi_SystemConfigFileCleanup
Deletes replaced or cleared media files from Stores → Configuration file fields. The module cleans up previously uploaded files when Magento system configuration file fields are saved with a replacement or empty value.
Installation
composer require aimanecouissi/module-system-config-file-cleanup
bin/magento module:enable AimaneCouissi_SystemConfigFileCleanup
bin/magento setup:upgrade
bin/magento cache:flush
Usage
When a Stores → Configuration file field backed by Magento\Config\Model\Config\Backend\File is saved with a
replacement file or an empty value, the previously stored media file is deleted. Fields that keep the same file value
leave the existing media file in place.
Uninstall
bin/magento module:disable AimaneCouissi_SystemConfigFileCleanup
composer remove aimanecouissi/module-system-config-file-cleanup
bin/magento setup:upgrade
bin/magento cache:flush
Changelog
See CHANGELOG for all recent changes.
License
This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.