How to Get File Name While Upload
The below function for Getting file name while file upload is written in Javascript used to give you an alert containing the file name of the file to be uploaded. The alert file prompt your confirmation to upload the file
Javascript Code to Get File Name While Upload
<script language="JavaScript"><!--
function extract(what) {
if (what.indexOf('/') > -1)
answer = what.substring(what.lastIndexOf('/')+1,what.length);
else
answer = what.substring(what.lastIndexOf('\')+1,what.length);
alert(answer);
}
//--></script>
<form name="myform">
<input type="file" name="myfile">
<input type="button" value="Test" onClick="extract(this.form.myfile.value)">
</form>