I need a small script to be written to save precious space in my server disk storage. I currently have more than 40,000 files in my server while I need only about 1500.
My shopping cart software does not delete the images of products that were deleted from my frontend store.
I can export a CSV list of all images URLs/jpg names that are currently in use, so I can determine which images I do not want to be deleted.
All the images are located in the same folder in my server.
I do not want the script to use my MySQL database, so the script should work from a HTML page that will allow me to upload a CSV/text file with all the images URLs to be kept save and the rest of the images found in the folder will be deleted. I also want the software to output how many files it's found and to request confirmation before the delete action.
Each product has by default 4 images in 4 different sizes named, for example: "[url removed, login to view]", "[url removed, login to view]", "[url removed, login to view]" and "[url removed, login to view]", so the scrip will have to search for any files which their names start with "14220-13369-" to keep them safe from deletion.