prathyusha

prathyusha

  • NA
  • 180
  • 72.8k

fileupload control

Jun 12 2013 4:52 AM
hi here i'm using this script for validate the image file like gif,jpg,
<script type="text/javascript">
        $(function() {
            $('#<%=PhotoUpload.ClientID %>').change(function() {
                var fileExtension = ['jpeg', 'jpg', 'png', 'gif', 'bmp'];
                if ($.inArray($(this).val().split('.').pop().toLowerCase(), fileExtension) == -1) {
                    alert("Only '.jpeg','.jpg', '.png', '.gif', '.bmp' formats are allowed.");
                }
            })
        })
    </script>
but after displaying alert message when i click ok fileupload control takes that file please help me

Answers (2)