Rename file with variable

is it possible with file_rename, to rename a file thanks to a variable, or to a field of a request?

Yes, you can use any dynamic expression there. Example:

{{$_POST.filename}}{ext}

Thanks its good for me