FileUploaded event not firing...Redux

2 posts, 0 answers
  1. Rich
    Rich avatar
    31 posts
    Member since:
    May 2011

    Posted 27 Mar 2013 Link to this post

    I am in the process of updating one of our web applications and replacing the RadUpload with the RadAsyncUpload control (along with updating all the other controls on the page).

    The definition from the .aspx page and the the code behind is below...the trouble is that the when I click the Import button, it fires the Page_Load event, telling me it is doing the post back, but the FileUploaded event does not fire, which means that the For Each loop I have in the Button_Click event doesn't see any Uploaded files, and nothing happens.
    I've since tried setting the PostbackTriggers attribute...still nothing.  Getting to the desperate stage here as we need to move this to production next week.  ANY ideas will be greatly appreciated.  Thx.

    Sorry if I'm missing something simple, this is my first crack at the Upload/AsyncUpload control, and I didn't see anything in the other threads that got me there.

    Thanks all!
            <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server"
                AllowedFileExtensions=".pdf" OnFileUploaded="RadAsyncUpload1_FileUploaded"
                MaxFileInputsCount="1" AllowedMimeTypes="application/pdf"
                Width="300px" InputSize="48" MaxFileSize="20600"
                EnableFileInputSkinning="False" Skin="Vista" ChunkSize="0"
        <td><asp:CheckBox ID="chkLibrary" runat="server" Text="Add To Library"/>
            <table cellpadding="2" cellspacing="2" width="100%" border="0">
                    <td style="width:100%;">
                        <asp:CustomValidator ID="Customvalidator1" runat="server"
                                <span style="FONT-SIZE: 11px;">Invalid file type.</span>
                        <asp:Button ID="buttonSubmit" runat="server" CssClass="RadUploadButton" Text="Import"  style="width:95px"/>
                        <asp:Button ID="ctlCancelButton" runat="server" OnClientClick="Cancel_Clicked();return false;" Text="Cancel" style="width:95px"/>
    Protected Sub RadAsyncUpload1_FileUploaded(sender As Object, e As Telerik.Web.UI.FileUploadedEventArgs) Handles RadAsyncUpload1.FileUploaded
         Dim targetFolder As String = RadAsyncUpload1.TargetFolder
         Response.Write(Server.MapPath(targetFolder & "/" & e.File.FileName))
     End Sub
  2. Peter Filipov
    Peter Filipov avatar
    1028 posts

    Posted 01 Apr 2013 Link to this post

    Hello Rich,

    I prepared a sample project for you, which demonstrates how the FileUploaded event is handled. Please review the attachment. Keep in mind that the event is fired only for successfully uploaded files.

    Peter Filipov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top