uploadcomplete
This article is about the uploadcomplete UDB event handler.
uploadcomplete
The uploadcomplete event may be called from web pages developed in Web Designer and processed by a USoft page engine service.
| Event | Applies to | Occurs when |
|---|---|---|
uploadcomplete | File Upload controls (FileUploadControl) | When the front-end has received a signal from the server that a file upload has completed, whether it succeeded or failed |
This event is triggered by the FileUploadControl class, once the server response to a file upload has been processed. It fires with success: true when the upload succeeded, and equally with success: false when the upload failed.
How to use
Find or create an Event Listener object with Event Type = uploadcomplete. Event Listeners are in the Web Designer Controls catalog:
Insert the event listener into the File Upload control. Insert a callClientScript action into the event listener. Use this action's Script property to code the behaviour that you want to see when the event occurs.
You are implicitly associating the event with an event handler function. This function has an options parameter. For available options, see the Options section at the end of this help topic:
function(*event*, *options*){ ... }
Options
When the event occurs, the following event handler function is called. You can use this function's options parameter in your event scripting.
function( *event*, *options* )
*event* ::= jQuery.Event
*options* ::= *event-options*
*event-options* ::= {
success: *success*,
data: *data*
}
*success* ::= { true | false }
Event contains the run-time details of the triggered event, of the event type stated above.
This syntax means that you can access an option by scripting:
options.*option*
Success indicates whether the upload succeeded (true) or failed (false).
Data is the upload result payload received from the server.