What to use instead of FileReader for Safari?

自闭症网瘾萝莉.ら 提交于 2019-11-27 15:07:47

Sadly, the only answer I can come up with will hog some extra bandwidth.

Firstly, use something like if (typeof FileReader !== "undefined" or Modernizr to follow your normal flow for the browsers that DO support FileReader. Otherwise, POST the file via AJAX to some server-side script that echoes back the contents.

So for compliant browsers, you get to save yourself some bandwidth and for non-compliant browsers you have to take one for the team.

Another solution is to use "A FileReader polyfill for Internet Explore and Safari using Flash"

See: https://github.com/Jahdrien/FileReader

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!