FileExplorer with multiple FTP configurations

2 posts, 1 answers
  1. Marco
    Marco avatar
    5 posts
    Member since:
    Jul 2014

    Posted 16 Jul 2014 Link to this post

    Hi to all,

    I would like to use the RadFileExplorer to connect to multiple FTP servers, the goal is to select in a RadDropDownList a previously configured FTP info from a database (FTP Server, Username, UserPassword) and then open the RadFileExplorer in a RadWindow with the selected RadDropDownList  values, and then pass to the server side or to a hidden the selected file path.

    It is posible to change the RadFileExplorer values in the codebehind? Do i need to use always a "FtpSettings.config" file?

    I have sean this example but as i understand it only use the .config file:

    Thanks in advance.
  2. Answer
    Dobromir avatar
    1633 posts

    Posted 21 Jul 2014 Link to this post

    Hi Marco,

    The content provider form the above mentioned article is using a config file as an example the information is loaded in the following method:
    private void ReadConfiguration()
        _protocolAndServer = VirtualPathUtility.RemoveTrailingSlash(ConfigurationManager.AppSettings["FtpServerName"]);
        _userName = ConfigurationManager.AppSettings["UserName"];
        _password = ConfigurationManager.AppSettings["Password"];
        _tempDirectory = Context.Server.MapPath(VirtualPathUtility.AppendTrailingSlash(ConfigurationManager.AppSettings["TempDirectoryPath"]));// Use the physical path
        _itemHandlerPath = ConfigurationManager.AppSettings["ItemHandlerPath"].Replace("~/", "");// Remove the starting "~/"

    and you can modify it to load the information as you want - in your particular case you can change this method to load dynamically settings based on a dropdown and you can access the dropdown on the page through the HttpContext object, e.g.:
    Page _pageContainsRadFileExplorer = HttpContext.Current.Handler as Page
    var dd = _pageContainsRadFileExplorer.FindControl("ConfigDD") as DropDownList


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top