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

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

1 Answer 87 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
ganesh
Top achievements
Rank 1
ganesh asked on 26 Jul 2018, 11:32 AM
how can i Combine Browse and Upload or (submit) into one step, combine them and have one button that says “Browse & Upload”

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 30 Jul 2018, 10:59 AM
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.
Tags
AsyncUpload
Asked by
ganesh
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or