Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to validate file type in jquery

var ext = $('#my_file_field').val().split('.').pop().toLowerCase();
if($.inArray(ext, ['gif','png','jpg','jpeg']) == -1) {
    alert('invalid extension!');
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #validate #file #type #jquery
ADD COMMENT
Topic
Name
7+6 =