I've discovered a number of legacy files amongst my image files have "+" in the filename which seems to be bothering some requests - i.e. the image does not display (although it used to display at one time in Backdrop on the pages.
Since I have hundreds of them is there a way to change the filename by replacing the "+" with "-and-" and not end up with duplicates in the Image Library?
And while I'm here - how do you remove unwanted images from the Image Library?
OK, I put together a quick and dirty module for you:
https://github.com/argiepiano/fix_my_files
It will replace the "+" with "-and-" in the file name and uri. After installing, visit the path
example.com/fix-my-files
This will NOT change the actual file names in the
files
folder! Only the database records. You'll need to rename the files manually using shell access andrename
or any other method.IMPORTANT:
max_execution_time
init value to a few minutes before running this.