Ask to rename a file if it already exists

The user is required to rename the uploaded or created file if it
already exists. The rule is suitable for all file formats now. Before it
only worked for Grace files. If the new file name has no extension, then
the old extension will be added.