Click here to Skip to main content
14,638,192 members
Rate this:
Please Sign up or sign in to vote.
See more:
My question is, How to preview image after immediately after clicking browse button in File Upload
Control, please suggest me, Thanks in Advance.
Posted
Comments
Telstra 19-May-14 8:24am
   
when exactly you want to preview image. Please improve your question
Baroor 20-May-14 8:48am
   
I want after browse button click which work on IE 8.
Rate this:
Please Sign up or sign in to vote.

Solution 2

   
Comments
Baroor 20-May-14 8:30am
   
Thanks for replying, but it is not working on IE 8.
Rate this:
Please Sign up or sign in to vote.

Solution 3

var reader = new FileReader();
    rFilter = /^(?:image\/bmp|image\/cis\-cod|image\/gif|image\/ief|image\/jpeg|image\/jpeg|image\/jpeg|image\/pipeg|image\/png|image\/svg\+xml|image\/tiff|image\/x\-cmu\-raster|image\/x\-cmx|image\/x\-icon|image\/x\-portable\-anymap|image\/x\-portable\-bitmap|image\/x\-portable\-graymap|image\/x\-portable\-pixmap|image\/x\-rgb|image\/x\-xbitmap|image\/x\-xpixmap|image\/x\-xwindowdump)$/i;


    function readURL(input) {
        if (input.files && input.files[0]) {
            //var reader = new FileReader();
            var oFile = input.files[0];
            if (!rFilter.test(oFile.type)) { alert("You must select a valid image file!"); return; }

            reader.onload = function (e) {
                $('#Cheque')
                    .attr('src', e.target.result)
                    .width(668)
                    .height(377);
            };
        }
    }


"#cheque" is img html tag
   
Comments
Baroor 20-May-14 8:27am
   
But it will not work on IE 8.
SOHAM_GANDHI 20-May-14 8:38am
   
try to use updated explorer
Baroor 20-May-14 8:43am
   
My project is for IE 8.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100