Hi,
I really like the replace functionality of the module but one thing confuses me (and my customers) a lot.
If I have a file like "filename_A.pdf" and I want to replace this file with a file named "filename_B.pdf" the file can be rename with the name field corresponding to the newly uploaded file. But (now the confusing part) the filename in the filesystem is still "filename_A.pdf". If a customer now downloads this file he gets a file with the content of the new "filename_B.pdf" but is named "filename_A.pdf".
I would like to see an option to select if I want to rename the file with the new filename or to just update the content of the file and keep the original filename.
grossmann-mcs

Comments

sheldonkreger’s picture

The problem with this idea is that if you have any absolute links to your file downloads, they will break when your file name is replaced. Therefore, if this is implemented, I believe it ought to be an optional setting by checkbox in the file edit interface.

grossmann’s picture

Yes that is right and I would keep the old functionality the default. But a checkbox with an option "Replace filename in filesystem" should work. I try to avoid direkt linking to files ether way as with files being entities now this is hardly necessary.

sheldonkreger’s picture

grossmann’s picture

Thanks sheldon for your work. But this attemtp does not change the file name in the file systems, right?
But having an option to change the entity name equaly to the file name of the replacement file is a nice time saver too.

peterx’s picture

Issue summary:View changes

I am looking at the patch in #3 for a different related use case, replace the URL of an external file. file_entity_file_is_writable() only returns true if the source is writeable. The page needs a slightly different question, as follows. Any other use cases?

Replace the link to the file