Unfortunately you cannot set a filter for the file browser dialog, but you could add a JavaScript function that would validate the extension of the selected file when a new file is selected. Thus you can prompt the user when he makes an invalid selection.
JS function
function checkFileExtension(elem) {
var filePath = elem.value;
if(filePath.indexOf('.') == -1)
return false;
var validExtensions = new Array();
var ext = filePath.substring(filePath.lastIndexOf('.') + 1).toLowerCase();
//Add valid extentions in this array
validExtensions[0] = 'doc';
//validExtensions[1] = 'pdf';
for(var i = 0; i < validExtensions.length; i++) {
if(ext == validExtensions[i])
return true;
}
alert('The file extension ' + ext.toUpperCase() + ' is not allowed!');
return false;
}
On your file upload Control
<asp:FileUpload ID="FileUpload1" runat="server" onchange ="checkFileExtension(this);" />