Validation for Asp FileUpload Control using JavaScript

function validatefileuploadcontrol()
        {       
        
            $( $('input[id*="FileUpload1"]')).change(function() {
                var fileExtension = ['doc', 'docx']; //Extensions
                if ($.inArray($(this).val().split('.').pop().toLowerCase(), fileExtension) == -1) {                
                    alert("'.doc', '.docx' formats are allowed.");
                }
            })
        }

Comments

Popular posts from this blog

How to copy DLLs from GAC.

Disable all day event, Recurrence,Workspace Fields in Calendar list