I'm very sorry. The example I gave is one from a project of my own.
Can u try to change
$files = $request->getUploadedFiles(); to
$files = $_FILES;
$_FILES is an associative array of items uploaded to the current script via the HTTP POST method.
Then you should be able to get the file and filename by using this:
$inputFile = $files['file']['tmp_name'];
$inputFileName = $files['file']['name'];
But to make sure, print the content of
$_FILES to see what it contains.