File system explorer

2 posts, 0 answers
  1. Antonio
    Antonio avatar
    1 posts
    Member since:
    Dec 2011

    Posted 20 Jan 2012 Link to this post


    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?

  2. Dobromir
    Dobromir avatar
    1633 posts

    Posted 24 Jan 2012 Link to this post


    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,
    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
  3. DevCraft R3 2016 release webinar banner
Back to Top