|
OSQA can accept image files to display as a part of article. The files are stored in upfiles folder in default. When the article which contains images is deleted, still the image files in the upfiles folder. Is there any tools/script which can do garbage collection? Thanks, Ted |
|
The issue with trying to do automatic deletion of those files is that the reference in the article may not be the only reference to the image. We don't have any reasonable way to track whether or not it is, so if we delete it other articles could potentially get broken. This is probably only a rare case, anyway, and maybe we could detect that locally uploaded images are present in the article and ask for user confirmation about whether or not to delete them. |
|
I have made a simple script that tries to garbage collect images. It works with psycopg2, but can easily be tweeked to work with an xml dump. You need to be in the upfiles folder to run it. It will only print images it finds not referenced in post. The problem / limitation / error is that it only checks the forum_node table for references to images. If there are other tables that need to be checked, please tell me which ones. Use this at your own risk.
deserves to be an answer in its own right, so I've converted it
(09 Aug '11, 06:27)
Andrew_S ♦
|
Tagged feature-requset.