1

I am not able to have below code working in IE. It works fine on Firefox and Chrome.

Anyone can help, how can make this function work on IE?

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

     reader.onload = function (e) {
        $('#img_prev')
                .attr('src', e.target.result)
                .width(160)
                .height(152);
    };

    reader.readAsDataURL(input.files[0]);
  }
}
1
  • It does't work on any function. Commented May 24, 2012 at 17:23

1 Answer 1

2

I've had a similar problem in the past. FileReader is not yet supported in IE:

http://html5demos.com/

You might need to rework your solution if IE support is required to include a regular file upload.

Sign up to request clarification or add additional context in comments.

2 Comments

Not for dragging and dropping files, we ended up going with a flash file uploader easyalgo.com/eaflashupload.aspx It doesn't support drag and drop but was still a clean solution.
MDN has a possible cross browser solution for image previews.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.