So according to the MDN reference on the input element accept=[MIME Type]
is unimplemented in Gecko and currently you can only do : accept=image|audio|video
One way you could do this is a server side check for the type on the asp.net-mvc controller.
But a nicer way would be to do it on the client with some javascript: Something like this:
<script>
function checkExt() {
if(document.mainForm.myfile.value.lastIndexOf(".txt")==-1) {
alert("Please upload only .txt extention file");
return false;
}
}
</script>
<form name="mainForm">
<input type="file" name="myfile" onchange="checkExt();"/>
</form>
See it running here:
http://jsfiddle.net/Egr9V/
If your using JQuery you could make your code slicker or use the Validation plugin as described in this post:
How to have jQuery restrict file types on upload?