This is a migrated thread and some comments may be shown as answers.

upload to root folder

1 Answer 79 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
David Austin
Top achievements
Rank 1
David Austin asked on 11 Mar 2010, 02:18 PM
Is there any way to always force the upload to the root folder of the file explorer?

1 Answer, 1 is accepted

Sort by
0
Lini
Telerik team
answered on 15 Mar 2010, 11:57 AM
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.
Tags
FileExplorer
Asked by
David Austin
Top achievements
Rank 1
Answers by
Lini
Telerik team
Share this question
or