Media file does not support replace existing file
Orchard Core does'nt support replace the exiting media file, and if I upload a same filename, will throw validation error.

I think the error message is pretty obvious.
Delete the file first.
I think the error message is pretty obvious.
Delete the file first.
Thanks for response. I post this isssue not to report the error, just asking if Orchard Core could implement a replace file feature.
The idea is not bad. We could instead ask if we want to replace the file just like when someone is copy/pasting a file in a folder where a file with the same name exists. So, the idea would be to show a pop-up that gives the user the choice to replace the existing file or not.
The idea is not bad. We could instead ask if we want to replace the file just like when someone is copy/pasting a file in a folder where a file with the same name exists. So, the idea would be to show a pop-up that gives the user the choice to replace the existing file or not.
Yeah, or provide a Replace button , user can explicitly replace the media file :-)

AFAIK most website shows a popup or you need to check to overwrite the existing file, I'm with @Skrypt on showing a popup instead
Having a modal that asks for what to do might be easier than select "replace media".
Having a modal that asks for what to do might be easier than select "replace media".
the Replace media button is also make sense, which means that when I want to replace a file with a new version, I can use the Replace media button to explicitly replace the file, and then select the new file in the File Dialog without having to make the local file name the same to the server -> then upload it -> and then pop up a prompt whether to replace it.
I think it will be hard to replace an image
imagine if you have a .jpeg, and want to replace it with a .png
How would that even work?
I think it will be hard to replace an image imagine if you have a
.jpeg, and want to replace it with a.pngHow would that even work?
Maybe the a <input type="file" accept="image/jpeg" /> should work ? or add a server side extension name validation, the new file's extension name should exactly the same with old file name.
@deanmarcussen It would not even be a file replace then right? I'm not sure I understand your concern with that?
the Replace media button is also make sense
I have the same concern as @deanmarcussen , you might click replace and select a file that has not the same binary format (a pdf instead of a txt for instance). You'd better be able to just drag and drop files with existing names, and get a warning. Like in Windows Explorer.
类也 (Seems to be related)https://github.com/OrchardCMS/OrchardCore/issues/2124
Thank @pgy866 you are totally right, this is the same thing. I am closing the other one since there are more discussions here.
Replace button, if the uploaded file name is different, it should be automatically changed to the same. Need to increase the suffix format limit of uploaded files. Such as (.jpg replace button file file selection box only displays .jpg format files) 替换 按钮,上传文件名若不同,应自动改相同。上传文件后缀格式限制。 如(.jpg 替换 按钮 文件,选择框内只显示.jpg格式文件)
the Replace media button is also make sense
I have the same concern as @deanmarcussen , you might click replace and select a file that has not the same binary format (a pdf instead of a txt for instance). You'd better be able to just drag and drop files with existing names, and get a warning. Like in Windows Explorer.
I think it will be hard to replace an image imagine if you have a
.jpeg, and want to replace it with a.pngHow would that even work?jsut the a
<input type="file" accept="image/jpeg" />should work, and also add a server side extension name validation, the new file's extension name should exactly the same with old file name.
Maybe we could both provider a same file name replacement confirm and also add a Repalce Button to the right of Edit Button of eatch file.
For example, if I want to update the picture of the product to a new picture, I should only need to select the new picture on the computer instead of making sure that the file name of the picture on the computer and the picture on the server are the same.
when I click the Replace Button, the media file name is product1.jpg , and I can select any file with .jpg extension (such as product20210821.jpg ), I can't select another extension's file (because the input type="file" dialog's accept filter has been limited by <input type="file" accept="image/jpeg" /> ), I can't select file with other extension such as .pdf .png.
@davidhayden @sebastienros @Skrypt
Has there been any work in regards to this? It's been a while and the issue still persists