No such function exists in Nextcloud itself and is also no desired due to security concerns as you can read her.
Nevertheless you should check the app store for an app which provides that function. The ShareRenamer app is currently unmaintained but a Sharing path app exists which provide the desired function.