---
title: "ImageUploaderFlash.RestrictionFailed Event HTML5/Flash Uploader "
canonical: https://www.aurigma.com/docs/us8/FH_E_ImageUploaderFlash_RestrictionFailed.htm
product: "Upload Suite 8"
---

# ImageUploaderFlash.RestrictionFailed Event HTML5/Flash Uploader 

Supported technologies: ![Adobe Flash](https://www.aurigma.com/docs/us8/icons/flash.png)![HTML 5](https://www.aurigma.com/docs/us8/icons/html5.png)
 
This event fires when some restriction is broken.

## Syntax
 
```aspx-cs
<script type="text/javascript">
function ImageUploaderFlash1_RestrictionFailed(errorCode, fileName, message){
    //...your code...
}
</script>
```

```
<aur:ImageUploaderFlash ID="ImageUploaderFlash1" runat="server">
    <ClientEvents>
        <aur:ClientEvent EventName="RestrictionFailed" HandlerName="ImageUploaderFlash1_RestrictionFailed" />
    </ClientEvents>
</aur:ImageUploaderFlash>
```
 
```
<script type="text/javascript">
function ImageUploaderFlash1_RestrictionFailed(errorCode, fileName, message){
    //...your code...
}
</script>
```

```
<?php
    $ImageUploaderFlash = new ImageUploaderFlash("ImageUploaderFlash1");
    //...other params...
    $ImageUploaderFlash->getClientEvents()->setRestrictionFailed("ImageUploaderFlash1_RestrictionFailed");
    //...other params...
    $ImageUploaderFlash->render();
?>
```
 
```
function ImageUploaderFlash1_RestrictionFailed(errorCode, fileName, message){
    //...your code...
}
```

```
$au.imageUploaderFlash({
    events: {
        //...other params...
        restrictionFailed: [ImageUploaderFlash1_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/FH_P_Aurigma_ImageUploaderFlash_Restrictions_MaxFileSize.htm.md)[MaxFileSize (PHP)](https://www.aurigma.com/docs/us8/FH_P_P_Restrictions_MaxFileSize.htm.md)[maxFileSize (JavaScript)](https://www.aurigma.com/docs/us8/FH_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/FH_P_Aurigma_ImageUploaderFlash_Restrictions_MinFileSize.htm.md)[MinFileSize (PHP)](https://www.aurigma.com/docs/us8/FH_P_P_Restrictions_MinFileSize.htm.md)[minFileSize (JavaScript)](https://www.aurigma.com/docs/us8/FH_P_J_$au_restrictions_minFileSize.htm.md) value;
- **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/FH_P_Aurigma_ImageUploaderFlash_Restrictions_MaxImageHeight.htm.md)[MaxImageHeight (PHP)](https://www.aurigma.com/docs/us8/FH_P_P_Restrictions_MaxImageHeight.htm.md)[maxImageHeight (JavaScript)](https://www.aurigma.com/docs/us8/FH_P_J_$au_restrictions_maxImageHeight.htm.md) or MaxImageWidth[MaxImageWidth (ASP.NET)](https://www.aurigma.com/docs/us8/FH_P_Aurigma_ImageUploaderFlash_Restrictions_MaxImageWidth.htm.md)[MaxImageWidth (PHP)](https://www.aurigma.com/docs/us8/FH_P_P_Restrictions_MaxImageWidth.htm.md)[maxImageWidth (JavaScript)](https://www.aurigma.com/docs/us8/FH_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/FH_P_Aurigma_ImageUploaderFlash_Restrictions_MinImageHeight.htm.md)[MinImageHeight (PHP)](https://www.aurigma.com/docs/us8/FH_P_P_Restrictions_MinImageHeight.htm.md)[minImageHeight (JavaScript)](https://www.aurigma.com/docs/us8/FH_P_J_$au_restrictions_minImageHeight.htm.md) or MinImageWidth[MinImageWidth (ASP.NET)](https://www.aurigma.com/docs/us8/FH_P_Aurigma_ImageUploaderFlash_Restrictions_MinImageWidth.htm.md)[MinImageWidth (PHP)](https://www.aurigma.com/docs/us8/FH_P_P_Restrictions_MinImageWidth.htm.md)[minImageWidth (JavaScript)](https://www.aurigma.com/docs/us8/FH_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/FH_P_Aurigma_ImageUploaderFlash_Restrictions_FileMask.htm.md)[FileMask (PHP)](https://www.aurigma.com/docs/us8/FH_P_P_Restrictions_FileMask.htm.md)[fileMask (JavaScript)](https://www.aurigma.com/docs/us8/FH_P_J_$au_restrictions_fileMask.htm.md);
- **6** - number of selected files exceeds the MaxFileCount[MaxFileCount (ASP.NET)](https://www.aurigma.com/docs/us8/FH_P_Aurigma_ImageUploaderFlash_Restrictions_MaxFileCount.htm.md)[MaxFileCount (PHP)](https://www.aurigma.com/docs/us8/FH_P_P_Restrictions_MaxFileCount.htm.md)[maxFileCount (JavaScript)](https://www.aurigma.com/docs/us8/FH_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/FH_P_Aurigma_ImageUploaderFlash_Restrictions_MaxTotalFileSize.htm.md)[MaxTotalFileSize (PHP)](https://www.aurigma.com/docs/us8/FH_P_P_Restrictions_MaxTotalFileSize.htm.md)[maxTotalFileSize (JavaScript)](https://www.aurigma.com/docs/us8/FH_P_J_$au_restrictions_maxTotalFileSize.htm.md) value;
- **11** - a warning displayed when a user adds a folder with too many files with drag-and-drop (some of files are ignored due to a Chrome bug).
 - 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/FH_T_Aurigma_ImageUploaderFlash_Restrictions.htm.md)[Restrictions (PHP)](https://www.aurigma.com/docs/us8/FH_T_P_Restrictions.htm.md)[restrictions (JavaScript)](https://www.aurigma.com/docs/us8/FH_T_J_$au_restrictions.htm.md)
- RestrictionFailed Property[RestrictionFailed (PHP)](https://www.aurigma.com/docs/us8/FH_P_P_ClientEvents_RestrictionFailed.htm.md)[restrictionFailed (JavaScript)](https://www.aurigma.com/docs/us8/FH_P_J_$au_events_restrictionFailed.htm.md)

### Manual
 
- [Configuring Restriction Rules for Files](https://www.aurigma.com/docs/us8/configuring-restrictions-and-file-filters-iuf.htm.md)
- [Using HTML5/Flash Uploader at Runtime](https://www.aurigma.com/docs/us8/using-image-uploader-flash-at-runtime.htm.md)
