This documentation is for the old version. Go to the latest Upload Suite docs

Uploader.BeforePackageUpload Event

Supported browsers: Internet ExplorerFirefoxGoogle ChromeSafari

This event fires when the current package is about to be prepared.

Syntax

ASP.NET
<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>
PHP
<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();
?>
JavaScript
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 FilesPerPackageFilesPerPackage (ASP.NET)FilesPerPackage (PHP)filesPerPackage (JavaScript) property is greater than or equal to 1; otherwise, this event works equally to the BeforeUpload.

Note

Calling the count() method from this event handler may result in an irrelevant value, since Image Uploader prepares and uploads packages in two different threads.

See Also

Reference

Manual