FileUpload allow Only Image Format Validate in JQuery


$('input:file').change(function () {
                var ext = this.value.split('.').pop();
                //   alert(ext);
                var FileExt = ['png', 'jpg','JPEG']
                if ($.inArray($(this).val().split('.').pop().toLowerCase(), FileExt) == -1) {
                    var xl = "Please Select image Files"
                    alert(xl);

                    this.$find('input:file').dispose();
                    return false;
                }


            });

Comments

Popular posts from this blog

Unable to perform operation on the item is locked in workspace

Insecure cookie setting: missing Secure flag

Display Canvasjs Line Chart using Data from Database