Document Filename is not getting renamed

Hi All,
My actual requirement is when a user is uploading a file if incase the filename contains any special characters as @/& we need to replace it with "_" automatically without any user action and show it on the interface with the renamed filename. But when I was trying with parameter filenames of fileupload() function it wasn't working as expected. So I tried with hardcode a file name as "Sample" but still if I upload a document, it still shows the original file name its not getting updated to"Sample" so kindly help me with the requirement. I have attached the screenshot for reference.
