ASP.NET File Upload Progress - OnClientFileRejected function

If OnClientFileRejected server-side property is set to some client-side function, this function is called with three parameters:
  1. Rejected file name
  2. Size of the file
  3. Maximum allowed size for this file, if less than zero - session with server was lost.


<%@ Register TagPrefix="fup" Namespace="OboutInc.FileUpload" Assembly="obout_FileUpload"%>
<script type="text/JavaScript">
function Rejected(fileName, size, maxSize){
  var addMessage = (maxSize >= 0)?("exceeds "+maxSize+" bytes"):("-- session lost");
  alert("File "+fileName+" is rejected \nIts size ("+size+" bytes) "+addMessage);
  <fup:FileUploadProgress OnClientFileRejected="Rejected" runat="server">
  <fup:Format Ext="*" MaxByteSize="102400"/>

See also working example Allowed file extensions and sizes.