As a technical exercise...programatically speaking, you would need to replace the element's #value_callback
, currently file_managed_file_value()
, with a custom one.
Your custom callback would invoke another custom function, a rewritten version of file_managed_file_save_upload()
, which would then invoke file_save_upload()
with FILE_EXISTS_REPLACE
as the 4th parameter, as opposed to the current value of FILE_EXISTS_RENAME
.
Real-world, you don't want to do this. As soon as someone uploads an image to a different node, it will obviously overwrite the existing one called image.jpg, and that new image will be used in place of the existing one for all other nodes.
That's why the renaming functionality exists in the first place; to avoid global collisions.