This event fires when the upload is about to be started.
<script type="text/javascript"> function Uploader1_BeforeUpload(){ //...your code... } </script>
<aur:Uploader ID="Uploader1" runat="server"> <ClientEvents> <aur:ClientEvent EventName="BeforeUpload" HandlerName="Uploader1_BeforeUpload" /> </ClientEvents> </aur:Uploader>
<script type="text/javascript"> function Uploader1_BeforeUpload(){ //...your code... } </script>
<?php $Uploader = new Uploader("Uploader1"); //...other params... $Uploader->getClientEvents()->setBeforeUpload("Uploader1_BeforeUpload"); //...other params... $Uploader->render(); ?>
function Uploader1_BeforeUpload(){ //...your code... }
$au.uploader({ events: { //...other params... beforeUpload: [Uploader1_BeforeUpload], //...other params... } })
Type: Boolean
If false
(or zero), the upload is cancelled. Otherwise, upload begins immediately after the event handler finishes.
This makes the event handler convenient for validating additional data provided by a user.