You could run some jQuery client-side validation to check:
$(function(){
$("input[type="submit"]").click(function(){
var $fileUpload = $("input[type="file"]");
if (parseInt($fileUpload.get(0).files.length)>2){
alert("You can only upload a maximum of 2 files");
}
});
});
http://jsfiddle.net/Curt/u4NuH/
But remember to check on the server side too as client-side validation can be bypassed quite easily.