I want to validate the file format.
How can i allow the user to upload only .xls file in jquery.
I am using uploadfy plugin to upload the file
Regards showreddy
I want to validate the file format.
How can i allow the user to upload only .xls file in jquery.
I am using uploadfy plugin to upload the file
Regards showreddy
Although this question was answered up top, you can bind a submit function to check the file by performing this below ->
$("#my_form").bind("submit", function(){
var ext = $('#my_file_field').val().split('.').pop().toLowerCase();
if($.inArray(ext, ['xls']) == -1) {
alert('invalid extension!');
}
});
This question was asked previously over at ->
You could set the option of uploadfy 'fileExt' : '*.xls'
But there is no way you can validate a file, that you are currently uploading to the server.