How to get path directory from FileReader()?

2020-04-10 00:26发布

Hi i have these codes to read the file the user has uploaded:

function readURL(input) {
  if (input.files && input.files[0]) {
    var reader = new FileReader();

    reader.onload = function(e) {
      $('#myImg').attr('src', e.target.result);
    }

    reader.readAsDataURL(input.files[0]);
  }
}

And the output is a whole chunk of data:

enter image description here

Is there any way i can get the path from the data? for example C:\Users\blackLeather\Desktop

If no,is there another way to get the image directory without having to add into another folder?

1条回答
Anthone
2楼-- · 2020-04-10 01:13

Is there any way i can get the path from the data?

No. None at all. That information is not provided to the JavaScript layer by the browser, for security reasons.

查看更多
登录 后发表回答