Hello there,
So my question is how could I call a custom event when the timeout reached? It seems nothing works. I have a plenty of events on my component but nor the @error neither the @canceled is triggered in this case.
Here is my component:
<vue-dropzone
:id="dropzoneID"
:ref="dropzoneID"
:options="dropzoneOptions"
@vdropzone-removed-file="removeUploadedFile"
@vdropzone-sending="onDropzoneSending"
@vdropzone-success="onDropzoneSuccess"
@vdropzone-cancel="onDropzoneCancel"
@vdropzone-error="onDropzoneError"
@vdropzone-max-files-reached="onDropzoneMaxFilesReached"
></vue-dropzone>
I understand that the @error event is called when the server responded with some error and the @canceled when you click on the 'Cancel Uploading' button.
Could someone please help me out?
Thank you in advance.
Hi @pigszel
Dropzone.js doesn't provide any events for a timeout. I'd perhaps trying using vdropzone-sending event and attaching something to the xhr object, eg
methods: {
sendingEvent (file, xhr, formData) {
xhr.ontimeout = function (e) {
console.log("Argh I timed out")
};
}
}
Hope that helps,
Rowan
@rowanwins you just saved my life. I don't know why I did not think about that :D
Thank you very much, it's working 馃憤
Happy days @pigszel - sorry for the slow reply,glad you got it sorted
Most helpful comment
Hi @pigszel
Dropzone.js doesn't provide any events for a timeout. I'd perhaps trying using
vdropzone-sendingevent and attaching something to the xhr object, egmethods: { sendingEvent (file, xhr, formData) { xhr.ontimeout = function (e) { console.log("Argh I timed out") }; } }Hope that helps,
Rowan