Ajax Uploader - Uploader_FileUploaded server event not firing - Firefox 5 Only

Last post 06-26-2011, 10:13 PM by Brena. 2 replies.
Sort Posts: Previous Next
  •  06-26-2011, 5:42 PM 68146

    Ajax Uploader - Uploader_FileUploaded server event not firing - Firefox 5 Only

    Hi, have an Ajax Uploader install working perfectly but now the file uploaded server event is not firing with Firefox 5.0. Have tried on 2 PCs with FF5, same result. Works fine with older FF versions and IE / Chrome. If I trigger a postback (with a test button inside the update panel)  the FileUploaded event then fires and server side code runs fine. If not using the below javascript (e.g. auto upload, no custom buttons) it also works. Could you please help by reviewing the below code and providing a solution? Thank you!
     
                <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>                
                                        <CuteWebUI:UploadAttachments ID="Uploader1" runat="server" ManualStartUpload="True"
                                            InsertButtonID="SelectButton" ValidateOption-MaxSizeKB="10240" CancelButtonID="CancelButton">
                                        </CuteWebUI:UploadAttachments>
                                
                                        <asp:LinkButton ID="SelectButton" runat="server" >Select Files to Upload</asp:LinkButton>
                                        <asp:LinkButton ID="CancelButton" runat="server">Cancel Upload</asp:LinkButton>
                                        <asp:LinkButton ID="UploadButton" runat="server" OnClientClick="return submitbutton_click()">Start Upload</asp:LinkButton>
                                            <asp:Button ID="Button1" runat="server" Text="Test Button to Trigger Postback" />
                      
                        </ContentTemplate>
                    </asp:UpdatePanel>
     
        <script type="text/javascript">

             function submitbutton_click() {
                 var submitbutton = document.getElementById('<%=UploadButton.ClientID %>');
                 var uploadobj = document.getElementById('<%=Uploader1.ClientID %>');
                 if (!window.filesuploaded) {
                     if (uploadobj.getqueuecount() > 0) {
                         uploadobj.startupload();
                          }
                     else {
                         var uploadedcount = parseInt(submitbutton.getAttribute("itemcount")) || 0;
                         if (uploadedcount > 0) {
                             return true;
                         }
                         alert("Please browse and select files to upload");
                     }
                     return false;
                 }
                 window.filesuploaded = false;
                 return true;
             }

             function CuteWebUI_AjaxUploader_OnPostback() {
                 window.filesuploaded = true;
                 var submitbutton = document.getElementById('<%=UploadButton.ClientID %>');
                 submitbutton.click();
                 return false;
             }
        </script>
     
     
    Filed under:
  •  06-26-2011, 9:10 PM 68147 in reply to 68146

    Re: Ajax Uploader - Uploader_FileUploaded server event not firing - Firefox 5 Only

    Hi Brena,
     
    I tested your code in Firefox 5,
     
    Just modified the function below
     
    1. function CuteWebUI_AjaxUploader_OnPostback() {  
    2.          window.filesuploaded = true;  
    3.          var submitbutton = document.getElementById('<%=UploadButton.ClientID %>');  
    4.          submitbutton.click();  
    5.          return true;  
    6.      }  
    It works fine. 
     
     
    Regards,
    Jeff 
  •  06-26-2011, 10:13 PM 68149 in reply to 68147

    Re: Ajax Uploader - Uploader_FileUploaded server event not firing - Firefox 5 Only

    Hi Jeff, thank you! Solved the problem. Appreciate your help and quick response =)
View as RSS news feed in XML