Uploads in Profile Changes with Admin Confirmation
Basics
If a profile change needs the confirmation of an administrator (plugin.),
an uploaded file - e.g. the profile image - is not assigned to the user right away. It is stored in the folder
_pending/ below the configured upload folder (plugin., default
1:) and listed in the change request:
{"image": {"old": [12], "new": 345, "upload": true}}
old holds the uids of the current file references of the field, new the uid of the pending file. The mail to
the administrator shows both images.
What happens with the pending file:
- Confirm: the file is moved to the upload folder and replaces the current file of the field. A previous file is deleted, as long as no other record refers to it.
- Refuse and Silent Refuse: the file is deleted.
- New change request of the same user: it replaces the pending one, so the file of the previous request is deleted.
Only files located in a _pending/ folder are moved or deleted, whatever uid a change request carries.
Note: files in _pending/ are publicly reachable like every file in a public storage, as long as somebody knows
the file name.
Cleanup
A change request nobody decides on keeps its file. Uploads no pending change request refers to any more can be removed with a command, e.g. as a scheduler task:
vendor/bin/typo3 femanager:cleanup-pending-uploads --dry-run
vendor/bin/typo3 femanager:cleanup-pending-uploads --older-than-hours=24
-- (default 24) keeps young files, so an upload of a request that is just being submitted is
not removed.