---
title: "Uploader.RestrictionFailed Event ActiveX/Java Uploader "
canonical: https://www.aurigma.com/docs/us8/JA_E_Uploader_RestrictionFailed.htm
product: "Upload Suite 8"
---

# Uploader.RestrictionFailed Event ActiveX/Java Uploader 

Supported browsers: ![Internet Explorer](https://www.aurigma.com/docs/us8/icons/ie8.png)![Firefox](https://www.aurigma.com/docs/us8/icons/firefox.png)![Google Chrome](https://www.aurigma.com/docs/us8/icons/chrome.png)![Safari](https://www.aurigma.com/docs/us8/icons/safari.png)
 
This event fires when some restriction is broken.

## Syntax
 
```aspx-cs
<script type="text/javascript">
function Uploader1_RestrictionFailed(errorCode, fileName, message){
    //...your code...
}
</script>
```

```
<aur:Uploader ID="Uploader1" runat="server">
    <ClientEvents>
        <aur:ClientEvent EventName="RestrictionFailed" HandlerName="Uploader1_RestrictionFailed" />
    </ClientEvents>
</aur:Uploader>
```
 
```
<script type="text/javascript">
function Uploader1_RestrictionFailed(errorCode, fileName, message){
    //...your code...
}
</script>
```

```
<?php
    $Uploader = new Uploader("Uploader1");
    //...other params...
    $Uploader->getClientEvents()->setRestrictionFailed("Uploader1_RestrictionFailed");
    //...other params...
    $Uploader->render();
?>
```
 
```
function Uploader1_RestrictionFailed(errorCode, fileName, message){
    //...your code...
}
```

```
$au.uploader({
    events: {
        //...other params...
        restrictionFailed: [Uploader1_RestrictionFailed],
        //...other params...
    }
})
```
 
### Parameters
 
 - errorCode
     - Type: **Number**
 
One of the following values:
 
- **0** - size of the selected file exceeds the MaxFileSize[MaxFileSize (ASP.NET)](https://www.aurigma.com/docs/us8/JA_P_Aurigma_ImageUploader_Restrictions_MaxFileSize.htm.md)[MaxFileSize (PHP)](https://www.aurigma.com/docs/us8/JA_P_P_Restrictions_MaxFileSize.htm.md)[maxFileSize (JavaScript)](https://www.aurigma.com/docs/us8/JA_P_J_$au_restrictions_maxFileSize.htm.md) value;
- **1** - size of the selected files is less than the MinFileSize[MinFileSize (ASP.NET)](https://www.aurigma.com/docs/us8/JA_P_Aurigma_ImageUploader_Restrictions_MinFileSize.htm.md)[MinFileSize (PHP)](https://www.aurigma.com/docs/us8/JA_P_P_Restrictions_MinFileSize.htm.md)[minFileSize (JavaScript)](https://www.aurigma.com/docs/us8/JA_P_J_$au_restrictions_minFileSize.htm.md) value;
- **2** - the selected image is CMYK, when CMYK images are denied for the upload (i.e. the EnableCmyk[EnableCmyk (ASP.NET)](https://www.aurigma.com/docs/us8/JA_P_Aurigma_ImageUploader_Restrictions_EnableCmyk.htm.md)[EnableCmyk (PHP)](https://www.aurigma.com/docs/us8/JA_P_P_Restrictions_EnableCmyk.htm.md)[enableCmyk (JavaScript)](https://www.aurigma.com/docs/us8/JA_P_J_$au_restrictions_enableCmyk.htm.md) is `false`);
- **3** - dimensions of the selected image are too large (i.e. image width or height exceeds the MaxImageHeight[MaxImageHeight (ASP.NET)](https://www.aurigma.com/docs/us8/JA_P_Aurigma_ImageUploader_Restrictions_MaxImageHeight.htm.md)[MaxImageHeight (PHP)](https://www.aurigma.com/docs/us8/JA_P_P_Restrictions_MaxImageHeight.htm.md)[maxImageHeight (JavaScript)](https://www.aurigma.com/docs/us8/JA_P_J_$au_restrictions_maxImageHeight.htm.md) or MaxImageWidth[MaxImageWidth (ASP.NET)](https://www.aurigma.com/docs/us8/JA_P_Aurigma_ImageUploader_Restrictions_MaxImageWidth.htm.md)[MaxImageWidth (PHP)](https://www.aurigma.com/docs/us8/JA_P_P_Restrictions_MaxImageWidth.htm.md)[maxImageWidth (JavaScript)](https://www.aurigma.com/docs/us8/JA_P_J_$au_restrictions_maxImageWidth.htm.md) value);
- **4** - dimensions of the selected image are too small (i.e. image width or height is less than the MinImageHeight[MinImageHeight (ASP.NET)](https://www.aurigma.com/docs/us8/JA_P_Aurigma_ImageUploader_Restrictions_MinImageHeight.htm.md)[MinImageHeight (PHP)](https://www.aurigma.com/docs/us8/JA_P_P_Restrictions_MinImageHeight.htm.md)[minImageHeight (JavaScript)](https://www.aurigma.com/docs/us8/JA_P_J_$au_restrictions_minImageHeight.htm.md) or MinImageWidth[MinImageWidth (ASP.NET)](https://www.aurigma.com/docs/us8/JA_P_Aurigma_ImageUploader_Restrictions_MinImageWidth.htm.md)[MinImageWidth (PHP)](https://www.aurigma.com/docs/us8/JA_P_P_Restrictions_MinImageWidth.htm.md)[minImageWidth (JavaScript)](https://www.aurigma.com/docs/us8/JA_P_J_$au_restrictions_minImageWidth.htm.md) value);
- **5** - the selected file has not allowed name (i.e. filename does not match FileMask[FileMask (ASP.NET)](https://www.aurigma.com/docs/us8/JA_P_Aurigma_ImageUploader_Restrictions_FileMask.htm.md)[FileMask (PHP)](https://www.aurigma.com/docs/us8/JA_P_P_Restrictions_FileMask.htm.md)[fileMask (JavaScript)](https://www.aurigma.com/docs/us8/JA_P_J_$au_restrictions_fileMask.htm.md), or matches DeniedFileMask[DeniedFileMask (ASP.NET)](https://www.aurigma.com/docs/us8/JA_P_Aurigma_ImageUploader_Restrictions_DeniedFileMask.htm.md)[DeniedFileMask (PHP)](https://www.aurigma.com/docs/us8/JA_P_P_Restrictions_DeniedFileMask.htm.md)[deniedFileMask (JavaScript)](https://www.aurigma.com/docs/us8/JA_P_J_$au_restrictions_deniedFileMask.htm.md));
- **6** - number of selected files exceeds the MaxFileCount[MaxFileCount (ASP.NET)](https://www.aurigma.com/docs/us8/JA_P_Aurigma_ImageUploader_Restrictions_MaxFileCount.htm.md)[MaxFileCount (PHP)](https://www.aurigma.com/docs/us8/JA_P_P_Restrictions_MaxFileCount.htm.md)[maxFileCount (JavaScript)](https://www.aurigma.com/docs/us8/JA_P_J_$au_restrictions_maxFileCount.htm.md) value;
- **7** - total size of selected files exceeds the MaxTotalFileSize[MaxTotalFileSize (ASP.NET)](https://www.aurigma.com/docs/us8/JA_P_Aurigma_ImageUploader_Restrictions_MaxTotalFileSize.htm.md)[MaxTotalFileSize (PHP)](https://www.aurigma.com/docs/us8/JA_P_P_Restrictions_MaxTotalFileSize.htm.md)[maxTotalFileSize (JavaScript)](https://www.aurigma.com/docs/us8/JA_P_J_$au_restrictions_maxTotalFileSize.htm.md) value;
 - fileName
     - Type: **String**
 
The name of the file which breaks the restriction.
 - message
     - Type: **String**
 
The message stating that the restriction is broken. The same message is displayed in the information bar.

## See Also
 
### Reference
 
- Restrictions Class[Restrictions (ASP.NET)](https://www.aurigma.com/docs/us8/JA_T_Aurigma_ImageUploader_Restrictions.htm.md)[Restrictions (PHP)](https://www.aurigma.com/docs/us8/JA_T_P_Restrictions.htm.md)[restrictions (JavaScript)](https://www.aurigma.com/docs/us8/JA_T_J_$au_restrictions.htm.md)
- RestrictionFailed Property[RestrictionFailed (PHP)](https://www.aurigma.com/docs/us8/JA_P_P_ClientEvents_RestrictionFailed.htm.md)[restrictionFailed (JavaScript)](https://www.aurigma.com/docs/us8/JA_P_J_$au_events_restrictionFailed.htm.md)

### Manual
 
- [Configuring Restriction Rules for Files](https://www.aurigma.com/docs/us8/configuring-restriction-rules-for-files-iu.htm.md)
- [Using Events](https://www.aurigma.com/docs/us8/using-javascript-api.htm.md)
