4.4.0

Events S3

The S3 uploader provides many of the same events as the traditional uploader, but there are some additional events exclusive to S3 endpoints. If you plan to use the S3 uploader, then use the following table as your event reference. All methods outlined in the core/traditional documentation are also available in Fine Uploader S3, unless otherwise noted here.

Syntax

There is a significant difference in the way events are defined between the jQuery and non-jQuery uploaders.

When using the non-jQuery version, events are defined as functions in the callbacks option object.

There are two things to keep in mind when using the jQuery plugin version. First, event handlers are defined by calling the jQuery .on() function which will bind a function to an event. Secondly, event handler parameters are passed an extra jQuery Event object. If using the jQuery plugin, this Event object will precede all arguments listed.

See the Integrating jQuery page for code examples and more details.

non-jQuery

When using the non-jQuery uploader, the following syntax is the correct way to define event handlers;

callbacks: {
    onDelete: function(id) {

    },
    onDeleteComplete: function(id, xhr, isError) {
    //...
    }
}

jQuery

The syntax below is only acceptable when using the jQuery plugin for the uploader:

$("#my_uploader").on("deleteComplete", function(event, id, xhr, isError) {
    //...
}).on("delete", function(event, id) {
    // ...
});

credentialsExpired

Called before a request is sent to S3 if the temporary credentials have expired. You must return a qq.Promise. If your attempt to refresh the temporary credentials is successful, you must fulfill the promise via the success method, passing the new credentials object. Otherwise, call failure with a descriptive reason.