Replace Existing File during Update
I have DataAssist setup with File Uploads on Insert and Update. Everything is working fine in that regard. I have my uploads set to "Replace" a file if that file name already exists, and this is working as expected.
But, during an update is there any way to remove the old file when the name is different so it no longer consumes space?
Example:
1: I upload file "AAA.jpg" as my default profile image. The file uploads, and the name is stored in the DB field.
2: During an update, I upload image "BBB.jpg" to change my profile image. BBB.jpg is uploaded, and the new filename is replacing the old filename name in the DB field. So far - so good as the database references the correct image.
The problem is - Now I am left with both "AAA.jpg" and "BBB.jpg" on the server. The database only references "BBB.jpg" so "AAA.jpg" is doing nothing but taking up space.