That is not about getting file name from the url of current page. I have a php file like that.
This should work for you:
Output:
myfile.doc