For a wee while I've been thinking it is strange that while the File module allows the management of files, the replace file function is lacking as it only allows for an upload of a replacement file from the local computer, but doesn't allow for the replacement of the file by one that may already be on the server.
e.g. I can replace "image+A.jpg" with "image-and-A.jpg" from my laptop, but I cannot replace it with "image-and-A.jpg" that already exists in a directory under the /files directory.
Personally I think this would be a good addition to the File module's features and could enhance an Administrators ability to rename files in the Image Library that may have been badly named by users prior to uploading them.
Comments anyone?
Comments
That's an interesting idea—I hadn't considered this before. Could you share a specific use case or scenario where this would be useful?
In a way, the File Manager serves as the system that manages files for a Backdrop site. It tracks which files are available on the server for Backdrop editors. If a file already exists in the file system, one might wonder why you would use it to replace another file that is also already in the system.
Replacing a file with one that is not yet managed seems like a more obvious use case. However, I assume the primary scenario here is that managed file 1 is used in multiple locations (e.g., 10 places), and you want to replace it everywhere with managed file 2, which is already in the system.
The result, however, would be that the exact same file ends up being managed twice within the system. Is that a good outcome?
Tim - My specific use case is for situations where a file is "named" by a user or editor incorrectly. If I use the example file name of Emily+Albert.jpg this falls outside of the accepted naming pattern used on the site.
Since this file is now a managed file, I do not appear to be able to rename it using our convention of "-and-" so that it becomes Emily-and-Albert.jpg via Backdrop (although that might just be my lack of knowledge about Backdrop and its modules).
I've looked at the Files module as a way to rename but the facility is not there, only the choice to manage or delete or replace via an upload from my laptop. Similarly there is no facility in the Image Library View, nor via the Paragraphs module which the site now uses (14 year old site originally set up under Typo3 then transferred to Drupal 4,5,6,7 then migrated to Backdrop) so there is a legacy mix of content types and layouts but all files used on the site are now "managed files". I'm also faced with a lack of a way to correct incorrectly image paths, e.g "Holiday 2022" to "Holiday_2022".
Does this clear it up as bit?