برای بررسی صحت فرمت فایل های آپلودی در ASP.net میتوان از قطعه کد زیر استفاده کرد.
در صورتی که کنترل FileUpload به صورت زیر باشد:
  1. <asp:FileUpload ID="fluFile" ClientIDMode="Static"  runat="server"  />  
 میتوان از قطعه کد زیر استفاده کرد:
  1. $(document).ready(function () {  
  2.     $("#<%= fluFile.ClientID %>").change(function () {  
  3.         var fileExtension = ['zip''rar''pdf''doc''docx''7z''ppt''pptx''xls''xlsx''xlms''pps'];  
  4.         if ($.inArray($(this).val().split('.').pop().toLowerCase(), fileExtension) == -1) {  
  5.             alert("فرمت های قابل قبول برای فایل : " + fileExtension.join(', '));  
  6.         }  
  7.     });  
  8. });