After struggling alot to find why the "accept:" method is not accepting zip file which is created by "WinRaR".. I changed the "accept" method with "extension" which is provided in "additional-methods.js" -- <script src="http://jquery.bassistance.de/validate/additional-methods.js"></script>
. Please find the latest code below:
JQUERY:
<script>
$().ready(function () {
// validate signup form on keyup and submit
$("#deploymentUploadForm").validate({
rules:{
File: {
required: true,
extension: "zip"
}
},
messages:{
File: {
required: "This field is mandatory!",
extension: "Accepts only zip file!"
}
}
});
});
</script>
If you don't want to include the full "additional-methods.js" then below is the method:-
jQuery.validator.addMethod("extension", function(value, element, param) {
param = typeof param === "string" ? param.replace(/,/g, '|') : "png|jpe?g|gif";
return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i"));
}, jQuery.format("Please enter a value with a valid extension."));
Thanks all for looking into the issue!