AsyncUpload doesn't work the first time

2 posts, 0 answers
  1. Mark
    Mark avatar
    82 posts
    Member since:
    Jan 2015

    Posted 17 Sep 2018 Link to this post

    Framework 4.0, Telerik version 2018.1.117.40, I click the select button and then it shows the file above with a green dot.  I select "Upload Files" and it goes away and the file is not in the folder until I do this a 2nd time and 3rd ... etc.  This is in the development environment.

    page code

     

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CheckerResultsReport.Default" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

    <!DOCTYPE html>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">    
        <link href="CSS/Main.css" rel="stylesheet" />
        <title></title>
    </head>
    <body>    
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
    <div class="DownloadForm">
            <h3>Attached Files:</h3>       
            <h5>Upload:</h5>
            <div class="UploadArea">
                <telerik:RadAsyncUpload MaxFileSize="52428800" ToolTip="Select file(s) then click Upload Files to save" RenderMode="Auto" runat="server" ID="RadAsyncUpload" MultipleFileSelection="Automatic" Skin="Office2010Blue" />
            </div>
            <div class="UploadButtonArea" >
                <telerik:RadButton CssClass="UploadButton" Text="   Upload Files   " id="btnUpload" runat="server" OnClick="btnUpload_Click"></telerik:RadButton>                               
            </div>
            <p>(max file size 50MB)</p>                           
            <div class="clear"></div>
            <script>                              
                if (Telerik.Web.Browser.ie && (Telerik.Web.Browser.version == 10 || Telerik.Web.Browser.version == 11))
                {
                    Telerik.Web.UI.RadAsyncUpload.Modules.FileApi.isAvailable = function () { return false; }
                }                                
                </script>
        </div>
    </form>
    </body>
    </html>

     

    Method

    protected void btnUpload_Click(object sender, EventArgs e)

            {            
                //******************************************
                //upload excel to temp folder, process and then delete
                //******************************************
                VirtualDirectory = ConfigurationManager.AppSettings.Get("FileStorageLocation");
           
                if (!Directory.Exists(VirtualDirectory))
                {
                    Directory.CreateDirectory(VirtualDirectory);
                }
                                                                      
                RadAsyncUpload.TargetFolder = VirtualDirectory;
            }

    web.config

    <?xml version="1.0"?>
    <!--
      For more information on how to configure your ASP.NET application, please visit
      http://go.microsoft.com/fwlink/?LinkId=169433
      -->
    <configuration>
      <system.web>    
        <customErrors mode="Off" />
        <httpRuntime maxRequestLength="32768" />
        <identity impersonate="false" />
        <compilation debug="true" targetFramework="4.0" />
        <httpHandlers>
          <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource" validate="false" />
          <add path="ChartImage.axd" verb="*" type="Telerik.Web.UI.ChartHttpHandler" validate="false" />
          <add path="Telerik.Web.UI.SpellCheckHandler.axd" verb="*" type="Telerik.Web.UI.SpellCheckHandler" validate="false" />
          <add path="Telerik.Web.UI.DialogHandler.aspx" verb="*" type="Telerik.Web.UI.DialogHandler" validate="false" />
          <add path="Telerik.RadUploadProgressHandler.ashx" verb="*" type="Telerik.Web.UI.RadUploadProgressHandler" validate="false" />
          <add type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=12.0.18.416, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" path="Telerik.ReportViewer.axd" verb="*" validate="true" />      
        </httpHandlers>
        <pages>
          <controls>
            <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" />
          </controls>
        </pages>
      </system.web>
      <appSettings>
        <add key="vs:EnableBrowserLink" value="false" /> 
        <add key="FileStorageLocation" value="\\kcstwebapplications\Attachments\CheckerResultsReportTemp\" />
      </appSettings>
      <system.webServer>
       <validation validateIntegratedModeConfiguration="false" />
        <handlers>
          <remove name="ChartImage_axd" />
          <remove name="Telerik_Web_UI_SpellCheckHandler_axd" />
          <remove name="Telerik_Web_UI_DialogHandler_aspx" />
          <remove name="Telerik_RadUploadProgressHandler_ashx" />
          <remove name="Telerik_Web_UI_WebResource_axd" />
          <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode" />
          <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode" />
          <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode" />
          <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode" />
          <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode" />
          <add name="Telerik.ReportViewer.axd_*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=12.0.18.416, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" path="Telerik.ReportViewer.axd" verb="*" preCondition="integratedMode" />
        </handlers>
        <security>
          <requestFiltering>
            <requestLimits maxAllowedContentLength="33554432" />
          </requestFiltering>
        </security>
      </system.webServer>
      <system.web.extensions>
        <scripting>
          <webServices>
            <jsonSerialization maxJsonLength="2147483644" />
          </webServices>
        </scripting>
      </system.web.extensions>
    </configuration>

     

  2. Mark
    Mark avatar
    82 posts
    Member since:
    Jan 2015

    Posted 17 Sep 2018 Link to this post

    Finally figured it out.  Needed to call the method code on startup
Back to Top