File is uploaded instantly and OnFileUploaded event not firing

2 posts, 0 answers
  1. Devon
    Devon avatar
    2 posts
    Member since:
    Feb 2016

    Posted 19 Jun 2017 Link to this post

    I am trying to use the RadAsyncUpload to upload a file, the file does get uploaded but it is uploaded as soon as it is selected and the OnFileUploaded event is never fired.  I have tried everything in the following links and none have worked: link1link2link3link4.  The .aspx file is quite large and so I will try to give all the important information without showing all lines of html.  The uploader is in a radpane whose visibility is set to false until the user makes a selection, that radpane is nested within mutiple radpanes and splitters, all of which are inside an asp Panel.  I am using the RadAjaxManager as well and I have added the uploader, panel and the postback trigger button to in an attempt to make it work.  Not sure if this will make a difference but the uploader is also not uploading to the TargetFolder.

    Here is the requestStart function to cause the postback (I do have the ClientEvents OnRequestStart in the ajaxManager):

    <telerik:RadCodeBlock ID="rcb1" runat="server">
                <script type="text/javascript">
     
                    function requestStart(target, arguments) {
                        if (arguments.get_eventTarget().indexOf("btnUpload") > -1) {
                            arguments.set_enableAjax(false);
                        }
                        if (arguments.get_eventTarget().indexOf("rauFile") > -1) {
                            arguments.set_enableAjax(false);
                            arguments.set_cancel(true);
                        }
                    }
                </script>
            </telerik:RadCodeBlock>

    Here is the html for the radasyncupload and the postbacktrigger button:

    <telerik:RadAsyncUpload ID="rauFile" runat="server" AllowedFileExtensions=".xls, .xlsx" HideFileInput="true" PostbackTriggers="btnUpload" MaxFileInputsCount="1" OnFileUploaded="rauFile_FileUploaded" TargetFolder="~/Uploads/Run Matrix/" />
    <telerik:RadButton ID="btnUpload" runat="server" Text="Upload" OnClick="btnUpload_Click" />
  2. Devon
    Devon avatar
    2 posts
    Member since:
    Feb 2016

    Posted 19 Jun 2017 Link to this post

    I wanted to add a picture that I hope will help show what is going on.  The attached is right after selecting the file but before pushing the Upload button, you can see that the file is already uploaded and not in the TargetFolder and the OnFileUploaded event did not fire.
Back to Top