Hi, I have a table of products in my sql database. Each product has an image and 4 thumbnails. These just store the filename of an image on the hard drive. The problem I have is that over time I have deleted thousands of products but the images still remain on the hard drive.
Now I need to build a script (in c# .net) to remove any orphaned images. I assume the only way is to get a list of products into memory and loop though all the images in the directory to cross reference and remove if they don't exist.
Has anyone come across this before and can you give me any advice?