Also remove stored files when a custom field file is removed
Original issue: https://issues.civicrm.org/jira/browse/CRM-21714
Affected versions: at least from 4.7.x
As discused on [https://chat.civicrm.org/civicrm/pl/hykmdoiht7b33d9fth1wrzpxqr]
When a custom field of type file is deleted, all stored files are keeped on the file system.
I think the files should be deleted at the same time as the custom field is deleted. To avoid possible confusion with the current behavior, I would modify the custom file field removal warning message to warn about the removal of files. Something like:
WARNING: Deleting this custom field will result in the loss of all '' data as well as the stored files. Any Profile form and listings field(s) linked with '' will also be deleted. This action cannot be undone. Do you want to continue?