- Upload Suite Overview
- What's New?
- Choosing Upload Technology
- Evaluating Upload Suite
- Upload Suite Editions
- System Requirements
- Installation and Deployment Notes
- ActiveX/Java Uploader
- HTML5/Flash Uploader
- Before You Started with HTML5/Flash Uploader
- HTML5/Flash Uploader Architecture
- HTML5/Flash Uploader User Interface
- Getting Started
- Using HTML5/Flash Uploader
- Troubleshooting
- Reference
- HTML5/Flash Uploader ASP.NET Reference
- HTML5/Flash Uploader PHP Reference
- HTML5/Flash Uploader JavaScript Reference
- HTML5/Flash Uploader Client-Side Events Reference
- ImageUploaderFlash Client-Side Events
- AfterPackageUpload Event HTML5/Flash Uploader
- AfterUpload Event HTML5/Flash Uploader
- BeforePackageUpload Event HTML5/Flash Uploader
- BeforeSendRequest Event HTML5/Flash Uploader
- BeforeUpload Event HTML5/Flash Uploader
- Error Event HTML5/Flash Uploader
- ImageEditorClose Event HTML5/Flash Uploader
- InitComplete Event HTML5/Flash Uploader
- PreRender Event HTML5/Flash Uploader
- Progress Event HTML5/Flash Uploader
- RestrictionFailed Event HTML5/Flash Uploader
- SelectionChange Event HTML5/Flash Uploader
- UploadFileCountChange Event HTML5/Flash Uploader
- ImageUploaderFlash Client-Side Events
- POST Field Reference
- Licensing Information
- Legal Notices
ImageUploaderFlash.AfterPackageUpload Event HTML5/Flash Uploader
This event fires when the current package was uploaded successfully.
Syntax
<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 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:
-
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.C#<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> -
Then use the AfterPackageUpload event handler to check this response using the response parameter. If it equals to
"Failed"the event handler should returnfalse.JavaScriptfunction afterPackageUpload(index, response){ if (response.substring(0, 6) == "Failed") return false; else return true; } - Right now the upload process stops and the Error event is fired with error code
18.