szaman
szaman

Reputation: 6756

Preview image for IE

I have script which shows me image in django form before I click submit.

        function upload_img(input, id) {
            if (input.files && input.files[0]) {
                var reader = new FileReader();
                reader.onload = function (e) {
                    $(id).attr('src', e.target.result);
                }
                reader.readAsDataURL(input.files[0]);
            }
        };

But it does not work for IE 9. Can I make it work for this browser?

Upvotes: 0

Views: 1456

Answers (1)

ant_Ti
ant_Ti

Reputation: 2435

IE 9 doesn't support FileReader but you can use this

Upvotes: 1

Related Questions