Q: How to open image in a modal window from html form file type When I choose an image from a form file input, how can I open the image in a modal popup window?
<input type="file" class="form-control">


A: You can get the Base64 from the input field and then append it to an <img> element, inside your modal. Find details in the link below.
FileReader.readAsDataURL()

A: You can use fancybox, but if you use base64 encode you have to set some setting for the image...like this:
      <script type="text/javascript">
  $(document).ready(function () {
      $('.fancybox-cs').fancybox({
         type        : 'image'
      });
  });
  </script>

