---
title: "ImageUploaderFlash.AfterPackageUpload Event HTML5/Flash Uploader "
canonical: https://www.aurigma.com/docs/us8/FH_E_ImageUploaderFlash_AfterPackageUpload.htm
product: "Upload Suite 8"
---

# ImageUploaderFlash.AfterPackageUpload 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 the current package was uploaded successfully.

## Syntax
 
```aspx-cs
<script type="text/javascript">
function ImageUploaderFlash1_AfterPackageUpload(packageIndex, response){
    //...your code...
}
</script>
```

```
<aur:ImageUploaderFlash ID="ImageUploaderFlash1" runat="server">
    <ClientEvents>
        <aur:ClientEvent EventName="AfterPackageUpload" HandlerName="ImageUploaderFlash1_AfterPackageUpload" />
    </ClientEvents>
</aur:ImageUploaderFlash>
```
 
```
<script type="text/javascript">
function ImageUploaderFlash1_AfterPackageUpload(packageIndex, response){
    //...your code...
}
</script>
```

```
<?php
    $ImageUploaderFlash = new ImageUploaderFlash("ImageUploaderFlash1");
    //...other params...
    $ImageUploaderFlash->getClientEvents()->setAfterPackageUpload("ImageUploaderFlash1_AfterPackageUpload");
    //...other params...
    $ImageUploaderFlash->render();
?>
```
 
```
function ImageUploaderFlash1_AfterPackageUpload(packageIndex, response){
    //...your code...
}
```

```
$au.imageUploaderFlash({
    events: {
        //...other params...
        afterPackageUpload: [ImageUploaderFlash1_AfterPackageUpload],
        //...other params...
    }
})
```
 
### Parameters
 
 - packageIndex
     - Type: **Number**
 
The zero-based index of the package inside the current upload session.
 - response
     - Type: **String**
 
The HTML code of the page returned from the server-side upload script after processing the current package.
 
### Return Value
 
Type: **Boolean**
 
If `false`, the upload process stops and the [Error](https://www.aurigma.com/docs/us8/FH_E_ImageUploaderFlash_Error.htm.md) event is fired with error code `18`.

## Remarks
 
You can use this event to stop the upload if the currently uploaded file fails some server-side verification. To do this you can use the following algorithm:
 
1. Write your server-side upload script. It should apply some verification to the uploaded file and put the corresponded string value to the response. For example, `"Success"` if the file meets verification conditions or `"Failed"` if does not.
 ```csharp
    <script runat="server">
    void Page_Load()
    {if (Request.Files.Count == 0)	return;
    if (VerifyFile(Request.Files[0]))	Response.Write("Success");else	Response.Write("Failed");
    }
    </script>
    ```
2. Then use the [AfterPackageUpload](https://www.aurigma.com/docs/us8/FH_E_ImageUploaderFlash_AfterPackageUpload.htm.md) event handler to check this response using the response parameter. If it equals to `"Failed"` the event handler should return `false`.
 ```
    function afterPackageUpload(index, response){if (response.substring(0, 6) == "Failed")	return false;else	return true;
    } 
    ```
3. Right now the upload process stops and the **Error** event is fired with error code `18`.

## See Also
 
### Reference
 
- [Error Event](https://www.aurigma.com/docs/us8/FH_E_ImageUploaderFlash_Error.htm.md)
- AfterPackageUpload Property[AfterPackageUpload (PHP)](https://www.aurigma.com/docs/us8/FH_P_P_ClientEvents_AfterPackageUpload.htm.md)[afterPackageUpload (JavaScript)](https://www.aurigma.com/docs/us8/FH_P_J_$au_events_afterPackageUpload.htm.md)

### Manual
 
- [Using HTML5/Flash Uploader at Runtime](https://www.aurigma.com/docs/us8/using-image-uploader-flash-at-runtime.htm.md)
- [Debugging ASP.NET HTML5/Flash Upload Scripts](https://www.aurigma.com/docs/us8/debugging-aspnet-upload-scripts-iuf.htm.md)
- [Debugging PHP HTML5/Flash Upload Scripts](https://www.aurigma.com/docs/us8/debugging-php-upload-scripts-iuf.htm.md)
