upload to root folder

2 posts, 0 answers
  1. David Austin
    David Austin avatar
    3 posts
    Member since:
    Mar 2010

    Posted 11 Mar 2010 Link to this post

    Is there any way to always force the upload to the root folder of the file explorer?
  2. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 15 Mar 2010 Link to this post

    Hi David Austin,

    It is not possible to force the upload only to a specific folder without including its child folders using the RadFileExplorer configuration. However, using some custom code, it is possible to restrict uploads to one folder. What you need to do is add a handler for the ItemCommand server event and change the uploaded file's path before it is saved. Here is some sample code:

    protected void RadFileExplorer1_ItemCommand(object sender, RadFileExplorerEventArgs e)
        {
            if (e.Command == "UploadFile")
            {
                string path = e.Path;
                path = path.Substring(path.LastIndexOf("/"));
                path = path.Replace("/", "/root/folder/location/");
                e.Path = path;
            }
        }


    Best wishes,
    Lini
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top