Search code examples
asp.nettelerik

Telerik upload multiple target folders


I've had a quick look through telerik's documentation and a search on here hasn't brought anything up.

Basically I'm after a single image to be uploaded to multiple folders using telerik's upload control. I know I can do this with asp:fileupload and that's the method I would normally use but I'm fed up of having one and a half thousand pounds worth of software and I never use any of the controls available :P

        <telerik:RadUpload ID="RadFeature1Image" runat="server" 
                           ControlObjectsVisibility="None" 
            TargetFolder="/content/img/portfolio/">
        </telerik:RadUpload>

That's my current code and it works fine basically what I'm after is to allow more than one target folder. Now I know with telerik's products in the past you could just comma separate the values but that shows an error.

Any help would be appreciated.


Solution

  • I don't believe this is possible; however, from the examples page:

      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...
      }
    

    I like Telerik's controls a lot but I haven't seen the UploadControl work with multiple target folders before - I have performed a copy to another folder using code similar to the example above, however.