Event list
Do not overwrite those as configuration options, unless you know what you're doing. | |
---|---|
Parameter | Description |
All of these receive the event as first parameter: | |
drop |
The user dropped something onto the dropzone |
dragstart |
The user started to drag anywhere |
dragend |
Dragging has ended |
dragenter |
The user dragged a file onto the Dropzone |
dragover |
The user is dragging a file over the Dropzone |
dragleave |
The user dragged a file out of the Dropzone |
All of these receive the file as first parameter: | |
addedfile |
When a file is added to the list |
removedfile |
Called whenever a file is removed from the list. You can listen to this and delete the file from your server if you want to. |
thumbnail |
When the thumbnail has been generated. Receives the dataUrl as second parameter. |
error |
An error occured. Receives the errorMessage as
second parameter and if the error was due to the XMLHttpRequest
the xhr object as third.
|
processing |
When a file gets processed (since there is a queue not all files
are processed immediately). This event was called processingfile
previously.
|
uploadprogress |
Gets called periodically whenever the file upload progress
changes. Gets the progress parameter as second parameter which
is a percentage (0-100) and the bytesSent parameter
as third which is the number of the bytes that have been sent to
the server.When an upload finishes dropzone ensures that uploadprogress will be called with a percentage of 100 at least once. Warning: This function can potentially be called with the same progress multiple times. |
sending |
Called just before each file is sent. Gets the xhr object and the formData objects as second and third parameters, so you can modify them (for example to add a CSRF token) or add additional data. |
success |
The file has been uploaded successfully. Gets the server response
as second argument. (This event was called finished
previously)
|
complete |
Called when the upload was either successful or erroneous. |
canceled |
Called when a file upload gets canceled. |
maxfilesreached |
Called when the number of files accepted reaches the
maxFiles limit.
|
maxfilesexceeded |
Called for each file that has been rejected because the number of
files exceeds the maxFiles limit.
|
All of these receive a list of files as first parameter and are
only called if the uploadMultiple option is true:
|
|
processingmultiple |
See processing for description. |
sendingmultiple |
See sending for description. |
successmultiple |
See success for description. |
completemultiple |
See complete for description. |
canceledmultiple |
See canceled for description. |
Special events: | |
totaluploadprogress |
Called with the total uploadProgress (0-100), the
totalBytes and the totalBytesSent . This
event can be used to show the overall upload progress of all
files.
|
reset |
Called when all files in the list are removed and the dropzone is reset to initial state. |
queuecomplete |
Called when all files in the queue finish uploading. |