Validate File extension on Client Side

by Mohan 2012-12-26 16:43:02

Hai,
To check the file extension while uploading the file jquery can be used.


var imgext = $('#file_upload').val().split('.').pop().toLowerCase();
if($.inArray(imgext, ['jpeg','jpg']) == -1) {
alert('invalid extension!');
return false;
504
like
0
dislike
0
mail
flag

You must LOGIN to add comments