Vue-dropzone: Trigger an event on timeout

Created on 16 Jul 2018  路  3Comments  路  Source: rowanwins/vue-dropzone

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.

awaiting feedback

Most helpful comment

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

All 3 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bruno-fernandes picture bruno-fernandes  路  4Comments

dainemedia picture dainemedia  路  4Comments

jd-0001 picture jd-0001  路  5Comments

zhangzhen picture zhangzhen  路  3Comments

stevenhardy-digital picture stevenhardy-digital  路  4Comments