Topic: stop in-progress upload in html5

Any way to stop the file that is uploading in html5? It looks like i can call some xhr.abort() function, any1 can help to give me any example? Thanks a lot

Re: stop in-progress upload in html5

Use the stop() function attached to your plupload instance.

3 (edited by foxontherock 2012-06-28 17:37:42)

Re: stop in-progress upload in html5

Oops? I "report" a post instead of replying... here is my answer


Wow ! I was searching for a solution to that problem, stopping the "current" uploading file.  I am now able to stop it with the uploader.stop, thank you!

That is my final solution:

    function stopUpload(fileID) {
        var file;
        file = uploader.getFile(fileID)
        var restart = 0;
        if (file.status == plupload.UPLOADING) {
            uploader.stop();

        }
        uploader.removeFile(file);
    }

AND


    function QueueChanged(up) {
        if (up.files.length > 0 && (up.state == undefined || up.state != plupload.STARTED)) {
           
            up.start();
        }
    }

Re: stop in-progress upload in html5

Nice job, it’s a great post. The info is good to know!