You can use jquery or javascript to do this:
<input type="file" name="question_pic" id="id_question_pic" max-uploads = 6/>
Then in jQuery you can do it like this
Var number_of_uploads;
$("#id_question_pic").change(function() {
if(number_of_uploads > $(this).attr(max-uploads))
{
alert('Your Message');
}
else
{
number_of_uploads = number_of_uploads + 1;
}
});
You can also do this in your view of the form in which you upload the file. But if you use Ajax download, that’s fine, I think.