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

File Explorer Not Seeing Virtual Directories

2 Answers 88 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 18 Aug 2010, 04:15 PM
Typically I use virtual directories in my websites,  so that when I publish a new version,  the directories the client works in,  do not get overwritten.

In using the File Explorer control,  I can not seem to get the control to see the virtual directories.

I could have sworn I have used server.mappath() on virtual directories before,  but rad file explorer doesnt return the directories or files.

Am I missing something? 

I will do a test on server.mappath to make sure im not crazy, which is entirely possible.  But I thought I would put the question out there to see if anyone can shine some light on it,  while I perform some tests.

Thanks,
M2

2 Answers, 1 is accepted

Sort by
0
Mike
Top achievements
Rank 1
answered on 18 Aug 2010, 04:22 PM
I checked,  and the virtual directories do indeed come back with an absolute path when I do server.mappath on the virtual directory within the direcotry I have in configuration : deletePaths, uploadpaths, ViewPaths, InitialPath.

Does the file explorer control use some other method for finding the sub folders than server.mappath?
0
Fiko
Telerik team
answered on 23 Aug 2010, 01:23 PM
Hi Mike,

Basically the default RadFileExplorer's content provider uses the GetFiles and GetDirectories methods of the System.IO.DirectoryInfo class in order to get the directories/files. If these methods returns the files/folders, then RadFileExplorer should work. as well. You can test the methods by using this test code:

protected void Page_Load(object sender, EventArgs e)
{
    string physicalPathToFolder = Server.MapPath("VirtualPathToFolder");
    System.IO.DirectoryInfo dirInfo = new System.IO.DirectoryInfo(physicalPathToFolder);
    System.IO.FileInfo[] files = dirInfo.GetFiles("*.*");
    System.IO.DirectoryInfo[] directories = dirInfo.GetDirectories();
}



All the best,
Fiko
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
Mike
Top achievements
Rank 1
Answers by
Mike
Top achievements
Rank 1
Fiko
Telerik team
Share this question
or