Rails+javascript - image preview before upload

后端 未结 4 1187
太阳男子
太阳男子 2021-02-13 16:08

I want to show an image preview before upload, for that I am using the code given below.

It works with firefox, but doesn\'t work with IE8

<%= image_t         


        
4条回答
  •  灰色年华
    2021-02-13 16:29

    I do use https://github.com/blueimp/jQuery-File-Upload for file uploads.

    In the spec of this jQuery plugin, you can read:

    Preview images can be loaded and displayed for local image files on browsers supporting the URL or FileReader interfaces.

    IE8 is not HTML5 compliant thus not compatible with FileReader. You should use flash or friends to achieve that.

    Firefox is HTML5 compliant...

提交回复
热议问题