Server Connect: File Rename

I want to add a feature where users can rename files which have been uploaded to a website
(eg PDFs and images). The File Rename feature in Server Connect looked like the obvious choice, but I think perhaps it isn’t. There is File Path field for the original file name, with static or variable options. However it seems the new name has to be based on a template.

It would make this feature more useful if in addition to the template option, the new name could be assigned using a variable - or is this already an option?

You will need a form where you can input the filename of your choice. Then, in the rename step, make sure that you add a global variable under $_POST to reflect the form input name attribute, e.g. ‘filename’. In the template use the $_POST value as in {{$_POST.filename)){ext}

1 Like

Many thanks Ben.

Just a heads up to anyone that finds this post, the Template part in Server Connect seems to now want

{{$_POST['filename']}}

Normally there would be no need to inform of this, but the template area has no dynamic selector available, so you have to add this manually at the moment.

2 Likes