About Upload

3 posts, 0 answers
  1. Mugil
    Mugil avatar
    21 posts
    Member since:
    Mar 2013

    Posted 12 Mar 2013 Link to this post

    Hi


          how to store multiple files into different target folder in telerik upload control



    Thank you 
    Mugil
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 13 Mar 2013 Link to this post

    Hello Mugil,

    You can use the SaveAs() to save the uploaded files to the desired target folder. For example you can check some conditions like file extension and based on that set the target path.

    If you set the TargetFolder or TargetPhysicalFolder property and then use the server-side API to manipulate the uploaded files, you may end up with two copies of the uploaded files. Be aware that any valid files will already be saved to the target folder.

    Please have a look into the following code that illustrates how to save uploaded files to a location of your choice.

    ASPX:
    <telerik:radupload id="RadUpload1" runat="server" />
    <asp:Button runat="server" ID="Button1" Text="Submit" OnClick="Button1_Click" />

    C#:
    protected void Button1_Click(object sender, System.EventArgs e)
    {
      foreach (UploadedFile f in RadUpload1.UploadedFiles)
      {
          f.SaveAs( "c:\\uploaded files\\" + f.GetName(), true);
          //You could copy the file to the other folders you have in mind here, or call f.SaveAs again or similar...
      }
    }

    Thanks,
    Princy.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mugil
    Mugil avatar
    21 posts
    Member since:
    Mar 2013

    Posted 13 Mar 2013 Link to this post

    Hi princy ,
     

          Thanks for your reply its working good.



        thanking you
        P.Mugil
Back to Top