{hero}

preUpload

Since: Editor 1.7.3

Triggered prior to each file being uploaded (cancellable).
Please note - this property requires the Editor extension for DataTables.

The full Editor reference documentation is available to registered users of Editor - the information shown below is a summary only. If you already have an Editor license please , alternatively an Editor license can be purchased on this site, or sign up for the free trial.

Description

This event is triggered whenever a file is uploaded (upload / uploadMany) by the end user. It can be used to modify the data being sent to the server as part of the upload, or to cancel the upload action after client-side validation has been performed.

Please note that in the case of uploadMany, if the user selects multiple files to be uploaded, this event will be triggered once for each file selected for upload. Each file can than be cancelled or not as required.

This event is cancellable by returning false from the event handler.

As of Editor 2.0.5 this event will accept a Promise as the returned value, allowing async actions such as client-side manipulation of the images to upload.