Getting File Duplicate Alert even if I have removed the file from upload

  •  10-19-2011, 7:46 AM

    Getting File Duplicate Alert even if I have removed the file from upload

    Hi,
     
     
    I am using following js while selecting files and when I remove one file from there and add the same file it is giving me alert that duplicate files. So can we remove the file from the array when we are removing the file from uploader??
     
     
        var uploadedFiles = [];
        function CuteWebUI_AjaxUploader_OnSelect(files) {
            var noDups = true;

            for (var i = 0; i < files.length; i++) {
                for (var j = 0; j < uploadedFiles.length; j++) {
                    if (files[i].FileName == uploadedFiles[j]) {
                        noDups = false;
                    }
                }
            }

            if (noDups) {
                for (var i = 0; i < files.length; i++) {
                    uploadedFiles.push(files[i].FileName);
                }
            }
            else {
                alert("Your last selection of files contains a duplicate filename, please try again");
            }
            return noDups;
        } 
     
     
    Thanks & regards,
    lbhatt
View Complete Thread
Powered by Community Server (Commercial Edition), by Telligent Systems