I have an async fileupload in use. What I need is, that a file with the same name can only be selected once.
User selects: a.pdf, b.pdf, c.pdf
> All 3 files are shown in the file list
User selects: c.pdf, d.pdf
> Only d.pdf should be added to the file list, because c.pdf has already been added.
User uploads files
> a.pdf, b.pdf, c.pdf, d.pdf get uploaded...
I don't care if its exactly the same file - just a comparison to the filename is enough. What I tried is to manipulate the select-event:
OnSelect: function (e)
var selectedFiles = $(".k-upload-files li #fileName");
e.files = $.grep(e.files, function (value)
for (var i = 0; i < selectedFiles.length; i++)
if (selectedFiles[i].innerHTML == value.name)
Well, that doesn't work so far. The list of files gets minimized correctly but the files are still added to the FileList. Hope someone can help me.