0

Just wanted to know is it possible to access/read a given file(if full filepath is enabled) using Javascript in HTML or any other technique.

I am quite new in HTML 5.

Thanks in advance

Thanks Vinod

vinod8812
  • 645
  • 10
  • 27
  • 1
    [Using files from web applications](https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications) – Quentin Jun 18 '13 at 10:29

2 Answers2

2

in HTML5 user allow you to process local files(reading only). See here

XMLHttpRequest object can be used to read files also

var txt = '';
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function(){
  if(xmlhttp.status==200 && xmlhttp.readyState==4){
    txt=xmlhttp.responseText;
  }
}
xmlhttp.open("GET","abc.txt",true);
xmlhttp.send();
Cody Tookode
  • 862
  • 12
  • 22
0

Yes, it is possible (& limited), but not recommended.. There you go :)

Yami
  • 1,405
  • 1
  • 11
  • 16