We have a CMS where people can upload images. We currently don’t offer a delete functionality, but it’d be nice to offer one.
The problem with offering the delete functionality is that people might delete an image they don’t need, but that same image might be used in someone else’s article.
Because people select the images with a WYSIWYG browser editor, we can not really easily track which image is used I think.
Anyone have a good solution on how to enable deletions without breaking other articles?
If you stored the image location in the database and the users picked from the database generated list you could add a reference count to the image record. Increment it when the image is added to the page, decrement it when it’s removed.
Then on your image management pages only enable delete if the reference count is 0.
Though if the users can edit their own HTML there’s nothing you can do to stop them (other than education) referencing images directly.