Image preview before upload in IE and Chrome

前端 未结 7 2024
说谎
说谎 2021-02-14 19:51

I am trying to design a module in which I would like to show a preview of the image to the user before he uploads the image to database.

I have found a solution which wo

7条回答
  •  借酒劲吻你
    2021-02-14 20:31

    This will not work in any other browser other than firefox because the FileReader object you are using is not a js standered, it is a class very specific to FireFox. As per web standard browser scripts(javascript) will not have security permission to read contents of any system resources(files).

    In IE you can try to get some ActiveXObject(FileSystemObject) help access the file system contents.

提交回复
热议问题