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

  •  10-07-2008, 11:30 AM

    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

View Complete Thread