| Page 1 of 1 | [ 6 posts ] |
Marc Lundgren
|
...will effectively halt the entire upload queue.
To easily reproduce this problem follow these steps where I add a cancel button for each file added, then see the error occur. 1. Use the source code provided in the multi files uploader demo: http://yuilibrary.com/yui/docs/uploader/uploader-multiple.html 2. Replace the block Y.each(fileList, function (fileInstance) { with: Code: Y.each(fileList, function (fileInstance) { fileTable.append("<tr id='" + fileInstance.get("id") + "_row" + "'>" + "<td class='filename'>" + fileInstance.get("name") + "</td>" + "<td class='filesize'>" + fileInstance.get("size") + "</td>" + "<td class='percentdone'>Hasn't started yet</td></tr>"); var button = Y.Node.create('<button type="button" id="' + fileInstance.get("id") + '" class="yui3-button" style="width:400px; height:35px;">Cancel ' + fileInstance.get("name") + '</button>'); Y.get("body").append(button); button.on("click", function() { uploader.queue.cancelUpload(fileInstance); }); }); 3. upload at least three large files (10+ MB). 4. cancel the first file once it begins it begins uploading Here you will notice the uploader will not not continue to upload files. It can be started again with Code: uploader.queue.startUpload(); but I'm not sure if this was intended. |
|
I have tried something similar on my end. Furthermore, once you hit startUpload(), it will start re-uploading the cancelled file instead the next one up.
The event.Filelist array remains unchanged. Unless you manually remove/reset the fileList array. like : uploader.set("fileList",newArray) |
Marc Lundgren
|
Removing the file from the fileList object manually, or splicing the fileList object and running uploadThese are the only work arounds that I've found to work for now. At least there is some sort of work around...
|
Allen RabinovichYUI Developer
|
Hi Marc,
This is, in fact, a bug: the cancelUpload(file) method in the UploaderQueue is not starting the upload of the next file after cancelling the current one. A better workaround for now would be to call "uploader.queue._startNextFile()" every time you cancel a running upload. I created a trac entry for the bug here: http://yuilibrary.com/projects/yui3/ticket/2532312 Simon: changing the fileList during an active upload has no effect; only changes before an upload initiated will apply (the queue creates its own copy of the fileList, it's stored in uploader.queue.queuedFiles once an upload has started (and that's the actual queue; it shrinks as uploads start and complete). |
|
What's the intended result of calling uploadAll() after cancelling a file? It seems the 2nd call to uploadAll() after a file was cancelled has no effect and I never get a 2nd uploadstart event.
|
|
NM, apparently hiding/showing the control was breaking it which is a documented no-no.
|
| Page 1 of 1 | [ 6 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group