i try validate csv file when user upload file with extension/format CSV
<script type="text/javascript">
$(document).ready(function() {
$('#form1').validate({
rules: { csv: { required: true, accept: "csv" }},
messages: { csv: "File must be CSV" }
});
});
</script>
<form action="product_import.php?action=import" method="POST" name="form1" id="form1" enctype="multipart/form-data">
<input name="csv" type="file" id="csv" />
</form>
But the problem is when i upload file with extension csv this error message will show up File must be CSV , i dont know why this script can't accept even i set to accept: "csv" .
My csv file name is product.csv