wilomgfx
4/12/2017 - 3:41 AM

preview-an-image-before-it-is-uploaded

preview-an-image-before-it-is-uploaded

function readURL(input) {

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

        reader.onload = function (e) {
            $('#blah').attr('src', e.target.result);
        }

        reader.readAsDataURL(input.files[0]);
    }
}

$("#imgInp").change(function(){
    readURL(this);
});