You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 19, 2026. It is now read-only.
Roman M. Yagodin edited this page Jan 23, 2020
·
2 revisions
Deleting file safely implies counting file references, which can be stored:
In the DNN content items
In the database table
In the HTML code (links) or elsewhere
Extension which provide safe file deletion (presumably with the corresponding content) will need to:
Get DNN content items related to the file
Get database records related to the file
If file is referenced by any content items or records, which is not about to be deleted right now, the file should not be deleted
If file is referenced only by content items or records, which is just about to be deleted, that file can be "safely" deleted
Probably it’s better try to delete content item/database records first, and only after that delete the file.
R7.Dnn.Extensions provide Content/ContentHelper.GetContentItemsByFile for p.1, while concrete extension should be responsible for implementing p.2 and general algorithm.
Implementation of p.3 looks like most problematic - it’s another reason to embrace implementing of DNN ContentItems API across various extensions.