Hola
elboletaire
Tu código me ha funcionado bien

Este es el ejemplo que he usado:
Código:
<html>
<head>
<script type="text/javascript">
function nomfitxer(){
var URLFitxer = document.getElementById("txtFileName").value;
document.getElementById("references").value = URLFitxer;
}
</script>
</head>
<body>
<input type="file" id="txtFileName" onchange = "nomfitxer()" />
<input type="text" id="references" />
</body>
</html>
Saludos,