I want to create a preview image before uploading to the server using jQuery.
My code, js code:
$(function(){ Test = { UpdatePreview: function(obj){
My html:
<input type='file' name='browse' onchange='Test.UpdatePreview(this)' /> <br/><br/> <img src="#" alt="test" width="128" height="128" />
See jsfiddle: http://jsfiddle.net/aAuMU/
After onload I see the src of the image (using the Google console application) and looks like this:
data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD//gAEKgD/4gv4SUNDX1BST0ZJTEUAAQEAAAvoAAAAAAIAAABtbnRyUkdCIFhZWiAH2QADABsA...
Is this a way to get image base in javascript and assign image in case i use IE as browser?
FileReader does not work in IE <10.
source share