FileUploaded event did not fire when file uploaded successfully !

Last post 06-04-2010, 1:16 PM by rberman. 16 replies.
Sort Posts: Previous Next
  •  09-28-2008, 5:56 AM 44345

    FileUploaded event did not fire when file uploaded successfully !

    Hey guys !
     
    I am in trouble : I use AjaxUploader for my DotNetNuke project, I put it on my usercontrol ! When the file is uploaded successfully  , I need view upload result for user by Listbox howerver the event FileUploaded did not fire ! I don't know why ! ( Do I have to use aspx instead of ascx ?)
    Please help me !
     
    If you have other ideas for my problems please contact me on  hungnc@vietgo.vn ! Thanks alot !
    Filed under:
  •  09-28-2008, 6:43 AM 44346 in reply to 44345

    Re: FileUploaded event did not fire when file uploaded successfully !

    Hi CCTS,
     
    I need more information, can you send you coed to me?
     
    Ken
     
  •  10-07-2008, 11:30 AM 44664 in reply to 44346

    Re: FileUploaded event did not fire when file uploaded successfully !

    I am currently having the same issue. The file upload gets to the end with 1 second remaining(but the entire file is there in the temp directory) and it hangs. If I hit cancel and try the upload again, it goes through (with both files in the temp directory). I am seeing the issue in IE7 and FireFox 3. It appears that the fileUploaded event does not fire. I am including the code from the aspx and vb files below:

    <CuteWebUI:Uploader ID="Uploader1" runat="server" ShowProgressBar="true" ShowProgressInfo="true"
    ValidateOption-MaxSizeKB="2000000" UploadType="Auto" UploadProcessingMsg="Processing File..."
    TempDirectory="~/UploaderTemp" OnFileUploaded="Uploader1_FileUploaded" EnableViewState="false">
    </CuteWebUI:Uploader>

     

    Protected Sub Uploader1_FileUploaded(ByVal sender As Object, ByVal args As CuteWebUI.UploaderEventArgs)

    Dim uploader As Uploader = DirectCast(sender, Uploader)

    Dim fargs As CuteWebUI.UploaderEventArgs = args

    Dim serverName As String = HttpUtility.UrlEncode(Request.ServerVariables("SERVER_NAME"))

    Dim filePath = Request.FilePath

    Dim destinationDIR As String = ""

    Dim pJob As String = Me.myJobInfo.jobName & " (" & Now().Month & "-" & Now().Day & "-" & Now.Year & " " & Now.Hour & "." & Now.Minute.ToString.PadLeft(2, "0") & "." & Now.Second.ToString.PadLeft(2, "0") & ")"

    destinationDIR = "c:\\testUpload\\" & Me.myJobInfo.customerID & "\\" & pJob & "\\"

    Dim d As New IO.DirectoryInfo(destinationDIR)

    If d.Exists = False Then

    d.Create()

    End If

    fargs.CopyTo(destinationDIR & fargs.FileName)

    fargs.Delete()

    Me.lblMessage.Text = generateBody().Replace(vbCrLf, "<br>")

    Me.uploadMV.ActiveViewIndex = 2

    End Sub

  •  10-08-2008, 4:37 AM 44683 in reply to 44664

    Re: FileUploaded event did not fire when file uploaded successfully !

    Hi acomas ,
     
    please test this code

    <%@ Page Language="VB" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <script runat="server">


        Protected Sub uplader1_FileUploaded(ByVal sender As Object, ByVal args As CuteWebUI.UploaderEventArgs)
            uplader1.InsertText = "test"
        End Sub
    </script>

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
    <CuteWebUI:Uploader ID=uplader1 runat=server OnFileUploaded="uplader1_FileUploaded"></CuteWebUI:Uploader>

        </div>
        </form>
    </body>
    </html>

     
    Regards
     
    Ken
  •  10-08-2008, 10:30 AM 44698 in reply to 44683

    Re: FileUploaded event did not fire when file uploaded successfully !

    I tried the above code and the button does change to "test" after the file is uploaded and copied 2x in the uploadTemp folder. This takes some time after the file is actually uploaded until the progress bar disappears.
     
     
  •  10-08-2008, 8:57 PM 44708 in reply to 44698

    Re: FileUploaded event did not fire when file uploaded successfully !

    Hi acomas,
     
    Do you want the FileUploaded event fire before the completion of the upload?
     
    like:
     
    1.fire some events(if true can upload,else can not upload)
    2.file upload
     
    if so,you can try the following code:

    <%@ Page Language="VB" %>


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html>
    <head id="HEAD1" runat="server">
        <title>test</title>
     </head>
    <body>
        <form id="MyForm" method="post" runat="server">

        <script language=javascript >
    //called when files be selected..
        function CuteWebUI_AjaxUploader_OnSelect(files)
    {

     //a long name , or a short name..
     var filename=files[0].FileName;
     //return false to cancel it..
     return false;
    }
        </script>
        <CuteWebUI:Uploader ID=uploader1 runat=server ></CuteWebUI:Uploader>
        </form>
    </body>
    </html>
     
    Regards
     
    Ken
  •  10-09-2008, 6:07 AM 44723 in reply to 44664

    Re: FileUploaded event did not fire when file uploaded successfully !

    I am experiencing the same problem as acomas and I just can't resolve it.  Can anyone confirm whether this control works inside a dynamically loaded user control rather than just a page object?

    My problem is:
    When I upload a file it gets stuck with 1 sec left on the progress bar and the FileUploaded routine never fires.  I have tested this in IE7 and Firefox 3 and it is consistent across both browsers.

    I have put this control in a user control and load the user control dynamically when the default.aspx page is loaded.  Could this be the problem?  Do you not support user controls?

    Any help in this regard would be greatly appreciated.  Did you manage to figure anything out Acomas?
  •  10-10-2008, 3:05 AM 44761 in reply to 44345

    Re: FileUploaded event did not fire when file uploaded successfully !

    Hi
     
    Please download the new version. and try again. I think this issue is fixed.
     
     
    Regards , Terry.
  •  10-10-2008, 4:42 AM 44771 in reply to 44761

    Re: FileUploaded event did not fire when file uploaded successfully !

    Hi Terry
     
    I have downloaded the latest version now and unfortunately the problem persists.
     
    I believe the problem only exists when this control is placed on a user control (.ascx) rather than on a page object (.aspx).  Any further ideas on how to fix this?  I am desperate to get this working as have a client project due for Monday and all was hunky dory until half of our pages were trying to use the control on a user control :(
     
    Regards
     
    Andrew
  •  10-10-2008, 9:01 AM 44779 in reply to 44771

    Re: FileUploaded event did not fire when file uploaded successfully !

    Hi all
     
    Ok...some progress and the problem identified - although not fixed yet...
     
    I am using a URL Rewriter module (http://urlrewriter.net/) and it seems that there is a conflict between that and the CuteWebUI AjaxUploader module.  At this point I am not sure where exactly it is.
     
    An example...
    I have the Ajax Uploader on a web user control and that web user control is in the path /controls/test.ascx.
    On the Page Load event of default.aspx, I use the LoadControl method to load the aforementioned user control onto the page.  The application knows to show this test page when Request.QueryString["page"] equals "test_upload".
     
    Now the interesting bit...
    The URL that I actually call is not default.aspx?page=test_upload but rather test_upload.aspx and this URL is then re-written to be default.aspx?page=test_upload.
    [I hope I am making sense so far!]
     
    In this scenario, the control doesn't work correctly and stops with 1 sec left to go and never fires the AttachmentAdded event.  HOWEVER...if I simply plug in default.aspx?page=test_upload then it works perfectly!...go figure.
     
    This is probably not a big deal to many and I have a workaround the problem for now, but it would be great if this can be solved.  Any ideas appreciated.
     
    Thanks.
  •  10-10-2008, 12:00 PM 44788 in reply to 44779

    Re: FileUploaded event did not fire when file uploaded successfully !

    mobbsie,
     
    I think currently you should find the real reason that cause the uploader stop work.
     
    Maybe it's because the user control , maybe because the urlrewriter , maybe because both of them.
     
    Can you try this thing ?
     
    1. create a new project, put the uploader into the page , and use the urlrewriter and test again.
     
    2. create a new project, put the uploader into usercontrol , and load it again and then test again.
     
    3. create a new project, use both usercontrol and urlrewriter and test again.
     
    You will get a deep conclusion ,
     
    And then you can send the source (which the uploader stop works) to me , terry @ cutesoft.net
     
    I will help you test it , and try to fix it.
     
     
    Regard,
    Terry
  •  10-11-2008, 12:46 AM 44806 in reply to 44788

    Re: FileUploaded event did not fire when file uploaded successfully !

    Hi,
     
    We have uploaded the new patch (20081011) .
     
    This version is better support for the urlrewriter.
     
    Regards , Terry .
  •  10-11-2008, 4:59 AM 44810 in reply to 44806

    Re: FileUploaded event did not fire when file uploaded successfully !

    This is brilliant - thanks Terry!  Problem solved :)
     
    I really appreciate the responsiveness of your team to my support requests.  The control is working perfectly well in my local environment (apart from the styling issues I mentioned in a separate post) and assuming all goes well when I test it on our server, you will receive a license purchase this weekend.
     
    Thanks again.
  •  11-18-2008, 11:16 AM 45917 in reply to 44345

    Re: FileUploaded event did not fire when file uploaded successfully !

    I found that the Ajaxuploader was triggering my requiredfiledvalidator once the upload finished. This is why the event did not fire in my case. Looking for a way to set causevalidation=false. Any Ideas?

  •  01-06-2009, 5:53 AM 47454 in reply to 45917

    Re: FileUploaded event did not fire when file uploaded successfully !

    Hey Victor,
     
    Use this for disabling your form validations
     
    Uploader1.InsertButton.ValidationGroup = "NoNeed";
     
    This will disable the validations which restricts the uploader to perform a postback.
     
    I hope this works.
     
    Regards,
    Amardeep
  •  01-06-2009, 11:48 PM 47480 in reply to 47454

    Re: FileUploaded event did not fire when file uploaded successfully !

    Hi,
     
    Thanks.
     
    We also disable the validation by default.
     
    We have upload the new patch , Please download the control and try again.
     
    Regards,
    Terry
  •  06-04-2010, 1:16 PM 61573 in reply to 47480

    Re: FileUploaded event did not fire when file uploaded successfully !

    I've posted a new, detailed message as I'm having the same problem, but only on a production server - in the integrated VS2008 web server for testing, it works.
View as RSS news feed in XML