maxailloud
10/31/2013 - 1:52 PM

Show dynamically image before upload it

Show dynamically image before upload it

$('upload_form_field').on('change', function(){
        var input = this;
        if (input.files && input.files[0]) {
            var reader = new FileReader();

            reader.onload = function (event) {
                console.log(event.target.result);
            };

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