I am going through questions and I found the exact same problem I have but the question was never answered. The link to the question is:
javascript how to read a local file Dcnied access
Basically, I am logged in as Administrator and running Visual Studio as administrator and my local file is under the C:\users\Administrator directory and my code is the exact same code as link's post and I'm getting Access Denied. here is my code:
function readTextFile(file) {
var rawFile = new XMLHttpRequest();
rawFile.open("GET", file, false);
rawFile.onreadystatechange = function () {
if (rawFile.readyState === 4) {
if (rawFile.status === 200 || rawFile.status == 0) {
var allText = rawFile.responseText;
alert(allText);
}
}
}
rawFile.send(null);
}
function kmlBtnClick () {
readTextFile("file:///c:/users/Administrator/KML/Operations.kml")
}
Can anyone help?