This is a migrated thread and some comments may be shown as answers.

FileUploaded event not firing...Redux

1 Answer 133 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Rich
Top achievements
Rank 1
Rich asked on 27 Mar 2013, 06:44 PM
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.
UPDATE:
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"
            TargetFolder="c:/TESTUPLOADS">
        </telerik:RadAsyncUpload>
     </td>
</tr>
<tr>
    <td><asp:CheckBox ID="chkLibrary" runat="server" Text="Add To Library"/>
    </td>
</tr>       
<tr>
    <td>
        <table cellpadding="2" cellspacing="2" width="100%" border="0">
            <tr>
                <td style="width:100%;">
                    <asp:CustomValidator ID="Customvalidator1" runat="server"
                     Display="Dynamic"
                     ClientValidationFunction="validateRadAsyncUpload1">
                            <span style="FONT-SIZE: 11px;">Invalid file type.</span>
                     </asp:CustomValidator>
                </td>
                <td>
                    <asp:Button ID="buttonSubmit" runat="server" CssClass="RadUploadButton" Text="Import"  style="width:95px"/>
                </td>
                <td>
                    <asp:Button ID="ctlCancelButton" runat="server" OnClientClick="Cancel_Clicked();return false;" Text="Cancel" style="width:95px"/>
                </td>
                 
            </tr>
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

1 Answer, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 01 Apr 2013, 08:10 AM
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.

Regards,
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.
Tags
AsyncUpload
Asked by
Rich
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Share this question
or