I am working on a website with a lot of images and PDF files that are updated regularly, but the old files are not deleted after the new ones are uploaded. Therefor I have a lot of files that are just sitting on the server without being used.
Is there a script or whatever else that I can run and will search for files that nothing is linking to?
EDIT :
I am not asking how to upload new files and delete the old ones in the future. I have already taken care of that.
I just want to know how to get rid of the files that are not in use any more.
Does that make sense?
Try this, just don't forget to change your directory
$dir = "/Your/directory/here";
Source: http://sun3.org/archives/297