See Live Demo.
http://stackoverflow.com/a/12369027
HTML
http://stackoverflow.com/a/12369027
HTML
type='file' onchange="readURL(this);" />
id="blah" src="#" alt="your image" />
JQuery
function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#blah') .attr('src', e.target.result) .width(150) .height(200); }; reader.readAsDataURL(input.files[0]); } }
No comments:
Post a Comment