Re: upload of files with same filenames

  •  09-24-2009, 11:29 AM

    Re: upload of files with same filenames

    Hi,
     
    Currently we has a sample for that :
     
    You many need the last version for the Cancel funciton of the select event.
     
    <script type="text/javascript">
     //prevent duplicated items:
        function CuteWebUI_AjaxUploader_OnSelect(files)
        {
      var sames=[];
      var items=uploader.getitems();
      for(var i=0;i<files.length;i++)
      {
       var file=files[i];
       var exists=false;
       for(var j=0;j<items.length;j++)
       {
        var item=items[j];
        if(item.FileName==file.FileName)
        {
         exists=true;
        }
       }
       if(exists)
       {
        sames.push(file.FileName);
        file.Cancel();
       }
      }
      if(sames.length>0)
      {
       alert("These file(s) are already in the queue : \r\n\t"+sames.join('\r\n\t'));
      }
        }
    </script>
     
    Regards,
    Terry
     
View Complete Thread