2
Answers

fileupload control

prathyusha

prathyusha

11y
891
1
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)