Closed SimJoSt closed 6 years ago
@SimJoSt onComplete need to be called for both success/error uploads. We would like to keep the same logic as the jQuery does - http://api.jquery.com/jquery.ajax/.
What you need is to use the API method and in a foreach
to check if all files are uploaded or not - item.uploaded == true
We use async and automatic upload and wanted to use the
onError
config option to trigger the validation, if a file isn't properly uploaded. It's important, so the customer realizes, that something is wrong more prominently (css adjustments) and is not able to submit the form. On resolution of these errors (retry/change to correct filesize/...) we want to pass the validation.onComplete
seemed perfect for that, unfortunately though, it is triggered on every upload try. It doesn't matter if it's successful or not. Even an unsuccessful retry, will triggeronComplete
. I believe it to be caused by our usage of the async and automatic upload.As the documentation states
I expect
onComplete
only to trigger, if all files have been uploaded successfully.