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

File system explorer

1 Answer 76 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Antonio
Top achievements
Rank 1
Antonio asked on 20 Jan 2012, 06:24 PM
Hi,

I was able get the FileExplorer to show files in a relative path within my project.
I'm now trying to show files in a physical location in my machine 'C:/Mediacontent/1' but I keep getting this error :

'C:/MediaContent/1' is a physical path, but a virtual path was expected.

I based my code in this example and I'm using a plain FileSystemContentProvider as the content provider type.
Can you help please?





1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 24 Jan 2012, 05:04 PM
Hi,

This error can be thrown if the physical path is used as a parameter to MapPath() method. However, in the source code of the content provider from the linked KB article, MapPath() is used only to locate the mapping file.
string physicalPathToConfigFile = Context.Server.MapPath(this.pathToConfigFile);
Where this.pathToConfigFile is a private filed in the class with the virtual path as value
private string pathToConfigFile = "~/App_Code/MappingFile.mapping"

Have you modified the value of pathToConfigFile? If so, please make sure that it is virtual path.

If this is not the case, could you please provide the exact configuration of RadFileExplorer, the MappingFile and the complete error's stack trace.

Kind regards,
Dobromir
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
FileExplorer
Asked by
Antonio
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or