I already searched for the specific error but couldn't really come up with a lot of useful information. The code in question returning the error is below.
JS:
var files = document.getElementById("file").files;
for (var i = 0; i < files.length; i++)
document.getElementById("filename").value = files[i].name;
document.getElementById("filename").setAttribute('value', files[i].name);
document.getElementById("filename") = document.getElementById("filename");
HTML:
<form action="../interface/upload.php" method="post" enctype="multipart/form-data">
<span class="btn btn-default btn-file btn-lg btn-block">
<i class="glyphicon glyphicon-file fileinput-exists"></i> Browse File <input type="file" id="file" onchange="getfile()" name="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
<input id="filename" type="text" class="btn" value="No file choosen" disabled="true">
</span>
<input type="submit" name="submit" value="Upload" class="btn btn-primary btn-lg btn-block">
</form>
The goal is to display the name of the selected file in the "filename" input.
For some reason this returns me the following error in IE8
ERROR / IE8:
Message: 'length' is Null or not an Object Line: 4 Character: 18 Code: 0 URI: http://localhost/assets/js/filechooser.js
Fix
function getfile(evt)
{
var filename = evt.value;
filename = filename.split('\\').pop();
document.getElementById("filename").value = filename;
}