This is a migrated thread and some comments may be shown as answers.
About Upload
2 Answers 19 Views
This is a migrated thread and some comments may be shown as answers.
Mugil
Top achievements
Rank 1
Mugil asked on 12 Mar 2013, 06:39 PM
Hi


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



Thank you 
Mugil

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 13 Mar 2013, 05:19 AM
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.

0
Mugil
Top achievements
Rank 1
answered on 13 Mar 2013, 04:11 PM
Hi princy ,
 

      Thanks for your reply its working good.



    thanking you
    P.Mugil
Asked by
Mugil
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Mugil
Top achievements
Rank 1
Share this question
or