Evet hocam tamda buydu ancak chrome konsolde denemek istedim https hatası veriyor bunu nasıl aşarız normalde ssl olan bir hostingle sorun çözülüyordu ancak localden hiç dosya okumak zorunda kalmamıştım nasıl çözülür bilmiyorum.
Hocam alttaki kodu denermisin?
<html>
<head>
<script>
var openFile = function(event) {
var input = event.target;
var reader = new FileReader();
reader.onload = function(){
var text = reader.result;
var node = document.getElementById('output');
node.innerText = text;
console.log(reader.result.substring(0, 200));
};
reader.readAsText(input.files[0]);
};
</script>
</head>
<body>
<input type='file' accept='text/plain' onchange='openFile(event)'><br>
<div id='output'>
...
</div>
</body>
</html>