I have a input type file named datafile and I want to show file name into a span when file is loaded into input:file

I have tried to echo $_FILES['datafile']['tmp_name'] but it output this E:\xampp\tmp\phpFE1E.tmp not the real file name. suppose I have file data.txt so I want to show data.txt into span when loaded into input file.

how Can I do this?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.