---
title: "Uploader.BeforePackageUpload Event ActiveX/Java Uploader "
canonical: https://www.aurigma.com/docs/us8/JA_E_Uploader_BeforePackageUpload.htm
product: "Upload Suite 8"
---

# Uploader.BeforePackageUpload 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 the current package is about to be prepared.

## Syntax
 
```aspx-cs
<script type="text/javascript">
function Uploader1_BeforePackageUpload(packageIndex){
    //...your code...
}
</script>
```

```
<aur:Uploader ID="Uploader1" runat="server">
    <ClientEvents>
        <aur:ClientEvent EventName="BeforePackageUpload" HandlerName="Uploader1_BeforePackageUpload" />
    </ClientEvents>
</aur:Uploader>
```
 
```
<script type="text/javascript">
function Uploader1_BeforePackageUpload(packageIndex){
    //...your code...
}
</script>
```

```
<?php
    $Uploader = new Uploader("Uploader1");
    //...other params...
    $Uploader->getClientEvents()->setBeforePackageUpload("Uploader1_BeforePackageUpload");
    //...other params...
    $Uploader->render();
?>
```
 
```
function Uploader1_BeforePackageUpload(packageIndex){
    //...your code...
}
```

```
$au.uploader({
    events: {
        //...other params...
        beforePackageUpload: [Uploader1_BeforePackageUpload],
        //...other params...
    }
})
```
 
### Parameters
 
 - packageIndex
     - Type: **Number**
 
The zero-based index of the package inside the current upload session.

## Remarks
 
**Note** 
This event makes sense if the FilesPerPackage[FilesPerPackage (ASP.NET)](https://www.aurigma.com/docs/us8/JA_P_Aurigma_ImageUploader_UploadSettings_FilesPerPackage.htm.md)[FilesPerPackage (PHP)](https://www.aurigma.com/docs/us8/JA_P_P_UploadSettings_FilesPerPackage.htm.md)[filesPerPackage (JavaScript)](https://www.aurigma.com/docs/us8/JA_P_J_$au_uploadSettings_filesPerPackage.htm.md) property is greater than or equal to `1`; otherwise, this event works equally to the [BeforeUpload](https://www.aurigma.com/docs/us8/JA_E_Uploader_BeforeUpload.htm.md).
 
**Note** 
Calling the [count()](https://www.aurigma.com/docs/us8/JA_M_J_$au_files_count.htm.md) method from this event handler may result in an irrelevant value, since ActiveX/Java Uploader prepares and uploads packages in two different threads.

## See Also
 
### Reference
 
- FilesPerPackage Property[FilesPerPackage (ASP.NET)](https://www.aurigma.com/docs/us8/JA_P_Aurigma_ImageUploader_UploadSettings_FilesPerPackage.htm.md)[FilesPerPackage (PHP)](https://www.aurigma.com/docs/us8/JA_P_P_UploadSettings_FilesPerPackage.htm.md)[filesPerPackage (JavaScript)](https://www.aurigma.com/docs/us8/JA_P_J_$au_uploadSettings_filesPerPackage.htm.md)
- BeforePackageUpload Property[BeforePackageUpload (PHP)](https://www.aurigma.com/docs/us8/JA_P_P_ClientEvents_BeforePackageUpload.htm.md)[beforePackageUpload (JavaScript)](https://www.aurigma.com/docs/us8/JA_P_J_$au_events_beforePackageUpload.htm.md)

### Manual
 
- [Using Events](https://www.aurigma.com/docs/us8/using-javascript-api.htm.md)
