1

How do i add a local path to the image. I Tried this

var file = new File("c:/documents and settings/downloads/image.jpg");
var reader  = new FileReader();

reader.onloadend = function () {
console.log(reader.result);
}
reader.readAsDataURL(file);

Gives an NS error.

user1268398
  • 35
  • 2
  • 6
  • It should be the backslash instead of..try this: new File("c:\\documents and settings\\downloads\\image.jpg"); – Typo Jul 25 '15 at 17:54
  • `new File` seems to be [deprecated](https://developer.mozilla.org/en-US/docs/Archive/Mozilla/SpiderMonkey/File_object). This post may help http://stackoverflow.com/questions/8390855/how-to-instantiate-a-file-object-in-javascript – Kirill Slatin Jul 25 '15 at 21:19

0 Answers0