Closed robfrancken closed 6 years ago
yes I think multiple: false, not working
You could try doing this before adding the replacement file.
var myUploader = $('#drag-and-drop-zone').dmUploader().data();
myUploader.queue = [];
myUploader.queuePos = -1;
myUploader.activeFiles = 0;
Hi @SapientHetero
Thanks for that. Your solution didn't work, but it got me on the right track.
Adding the following in onNewFile() callback did the trick.
var myUploader = $('#drag-and-drop-zone').dmUploader().data();
myUploader.dmUploader.queue = [];
Glad to hear it helped. Thanks for letting me know.
On Mon, Oct 29, 2018, 7:44 PM Rob Francken notifications@github.com wrote:
Hi @SapientHetero https://github.com/SapientHetero
Thanks for that. Your solution didn't work, but it got me on the right track.
Adding the following in onNewFile() callback did the trick.
var myUploader = $('#drag-and-drop-zone').dmUploader().data(); myUploader.dmUploader.queue = [];
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/danielm/uploader/issues/69#issuecomment-434121050, or mute the thread https://github.com/notifications/unsubscribe-auth/AlmII-V5j9fd_rR8ny1D56n-MS6yFy74ks5up5LlgaJpZM4Srel7 .
I'm hoping someone can help me with this.
I have a single upload field, and I'm using the
extraData()
method to allow naming the file. I'm also using controls to start the upload.The problem is this. When a user selects a file, and then changes the file before starting the upload, the newly selected file gets added to the queue. How can I override the queue with the last file selected so that I only upload 1 file at a time?
I thought setting
multiple: false,
would take care of it, but it doesn't appear to do anything, besides limit selection to a single file.After changing the file, the queue looks like this:
I am trying to do this:
This gives me an undefined error, so I'm obviously accessing the object incorrectly.