Hello,
I have an async fileupload in use. What I need is, that a file with the same name can only be selected once.
e.g.:
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:
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.
Thank you!
I have an async fileupload in use. What I need is, that a file with the same name can only be selected once.
e.g.:
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)
return false;
}
return true;
});
}
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.
Thank you!