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

File is uploaded instantly and OnFileUploaded event not firing

1 Answer 302 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Devon
Top achievements
Rank 1
Devon asked on 20 Jun 2017, 12:10 AM

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" />

1 Answer, 1 is accepted

Sort by
0
Devon
Top achievements
Rank 1
answered on 20 Jun 2017, 12:39 AM
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.
Tags
AsyncUpload
Asked by
Devon
Top achievements
Rank 1
Answers by
Devon
Top achievements
Rank 1
Share this question
or