-2

I was wondering if anyone knew of a JS, AJAX, or JQUERY function that can allow a preview of an uploaded pic. I liked this solution I found here...

Preview an image before it is uploaded

But, FileReader API is only supported in IE10 and above. I need a function that works for IE9 as well. Any ideas?

Community
  • 1
  • 1
Stevo
  • 85
  • 2
  • 10

1 Answers1

1

It's not possible, before HTML5 Javascript could not read a file on the file system with HTML5 this changed and we got the File API's added before that security said there was no web page access of a file on the machine so this is not possible. in any browser that does not have support for the HTML5 File API's.

you could have a default no preview available, so just before you render you preview change it to an image saying preview is not available in this browser and if the render does not work in the browser it wont change it (dont forget to use Try and Catch) so you can handle the error

Barkermn01
  • 6,295
  • 30
  • 71