ZeroByte File and Queue not clearing itself once you click remove (X) on a file list.

Last post 08-23-2012, 12:27 PM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  08-22-2012, 8:44 AM 74468

    ZeroByte File and Queue not clearing itself once you click remove (X) on a file list.

    Hello,

     

    Regarding the zero byte file check - it used to work perfectly fine, however for some reason it just does not work anymore. 

    1. <%  
    2.                 Dim uploader  
    3.                 Set uploader=new AspUploader  
    4.                 uploader.MaxSizeKB=10240  
    5.                 uploader.Name="myuploader"  
    6.                 uploader.InsertText="Browse Files"  
    7.                 uploader.MultipleFilesUpload=false                
    8.                 uploader.ManualStartUpload=true  
    9.                 uploader.UploadType="IFrame"  
    10.                 'uploader.AllowedFileExtensions="doc,docx,xls,xlsx"  
    11.                 'uploader.DialogFilter="Documents (doc/docx/xls/xlsx)|*.doc;*.docx;*.xls;*.xlsx|All files (*.*)|*.*"  
    12.                 uploader.TempDirectory="testfiles"  
    13.                 'uploader.SaveDirectory="files"  
    14.   
    15.                 %>  
     Then towards the bottom I have under <Script> tag:

    1.  function CuteWebUI_AjaxUploader_OnSelect(files) {  
    2.   
    3.             for (var i = 0; i < files.length; i++) {  
    4.                 var size = files[i].FileSize  
    5.                 if (size == 0) {  
    6.                     alert("" + files[i].FileName + " is a zerobyte file and they are not allowed");  
    7.                     files[i].Cancel();  
    8.                 }  
    9.             }  
    10. }  

     Also I am running the uploader as a single file uploader and it runs fine. One issue that I came up with and cannot figure out how to resolve is when I select a file to upload and it shows the file in the QueueList, I have it set to confirm with the user to make sure that they really want to upload the (filename) with a yes and a no button. However, if by chance the user says no or removes the file from the queuelist and choose another file.

     

    The Alert confirmation does not clear itself. If I was  to click on Upload without having to select a file afterwards or by selecting another file, it will show me the filename of the file I choose prior and will show me the file name I have selected now with a comma seperating the two or if I removed the file, it will still show me the filename that I choose prior. Please see screenshots below to better understand.

     

     

     

     Now the above is doing what it shoulud be. If I was to remove the file by clicking on the X, the alert still shows me the filename when I click on Upload.

     

     

     For some reason it is not clearing itself when you click remove. Now what happens is if I do this with multiple files it just keeps adding the name of the files to the alert like so:

     

     

     

     Is there a way to clear the pop up everytime I change my mind? or remove a file that was selected to upload?

     

    This also happens if I change my mind and browse and select different files in one session, it shows all the files with comma in the alert pop up.

     

    Thanks,

    Khan 

     

     

     

     

  •  08-23-2012, 12:27 PM 74473 in reply to 74468

    Re: ZeroByte File and Queue not clearing itself once you click remove (X) on a file list.

    Hi mskhan,

     

    Can you show me the full exmaple page code which can reproduce this issue? so I can test it on my end.

     

    Regards,

     

    Ken 

View as RSS news feed in XML