Hi Monique,
Per default Mendix does not store your file in the contents attribute. Mendix stores files on the File server of the application server that runs your application.
Since uploading a file is a browser (client) activity you need to wait untill the uploading is done, before you can pull the FileName attribute from the File Entity. So If you really want to accoimplish what you want, you need to download and install HTML/javascript snippet in order to write your own HTML /javascript.
Hope this will help,
Jan