0

In the file upload after uploading the image I need to show immediately that image in the another division which is available in same page without refreshing full page I used location.reload() but that is reloading full page.

Ashkan Mobayen Khiabani
  • 33,575
  • 33
  • 102
  • 171
nazar tvm
  • 99
  • 7

2 Answers2

0

You could use ajax and you can load a portion of the page.

Check it out

http://api.jquery.com/jquery.ajax/

Arun Bertil
  • 4,598
  • 4
  • 33
  • 59
  • by using ajax request i am sending image to server its saving in the database but it is not showing in the division until i reload my page – nazar tvm Apr 22 '15 at 05:36
0

You can see similar question related to it.

<script type="text/javascript">
    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]);
        }
    }
</script>
<body>
    <form id="form1" runat="server">
          <input type='file' onchange="readURL(this);" />
         <img id="blah" src="#" alt="your image" />
    </form>
</body>

how to preview a image before and after upload?

Community
  • 1
  • 1
Jalpesh Vadgama
  • 13,653
  • 19
  • 72
  • 94