AsyncUpload UPLOAD: Combine Browse and Upload or (submit) into one step

2 posts, 0 answers
  1. ganesh
    ganesh avatar
    1 posts
    Member since:
    Feb 2018

    Posted 26 Jul 2018 Link to this post

    how can i Combine Browse and Upload or (submit) into one step, combine them and have one button that says “Browse & Upload”
  2. Rumen
    Admin
    Rumen avatar
    13980 posts

    Posted 30 Jul 2018 Link to this post

    Hello Ganesh,

    Please review and try the solution provided in the following forum thread on the subject: Automatic upload, i.e.

    ASPX
    <script type="text/javascript">
          function filesUploaded(sender, args) {
              $find("ajaxManager").ajaxRequest("upload");
          }
      </script>
     
      <telerik:RadAjaxManager runat="server" ID="ajaxManager" OnAjaxRequest="ajaxManager_AjaxRequest">
          <AjaxSettings>
              <telerik:AjaxSetting AjaxControlID="ajaxManager">
                  <UpdatedControls>
                      <telerik:AjaxUpdatedControl ControlID="asyncUpload" />
                  </UpdatedControls>
              </telerik:AjaxSetting>
          </AjaxSettings>
      </telerik:RadAjaxManager>
      <telerik:RadAsyncUpload runat="server" ID="asyncUpload" OnClientFilesUploaded="filesUploaded"TargetFolder="~/Uploads"></telerik:RadAsyncUpload>

    Codebehind

    protected void ajaxManager_AjaxRequest(object sender, AjaxRequestEventArgs e)
       {
           if (e.Argument == "upload")
           {
               foreach (UploadedFile file in asyncUpload.UploadedFiles)
               {
                   file.SaveAs(Server.MapPath("~/Uploads/") + file.FileName);
               }
           }
       }



    Regards,
    Rumen
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top