Use FileBrowserContentProvider with Physical Path

5 posts, 0 answers
  1. k f
    k f avatar
    109 posts
    Member since:
    Jun 2006

    Posted 05 Jul 2009 Link to this post


    RadControls version

    Q1 & Q2  2009

    .NET version


    Visual Studio version


    programming language


    browser support

    all browsers supported by RadControls

    I have a content editing system I'm building to host websites for customers.  The admin utility is a part of it's own website and needs the ability to allow users to use RadEdit to upload and utilize images which reside in folders in their own web apps.

    So I needed a way to copy, manipulate files using a phyical path such as c:\inetpub\customerA\images while the admin application resides in C:\inetpub\CMSUI.

    Using the DB example, I modified the code to create RadEditorRelativeProvider and also the Handler.ashx to accomplish what I set out to do.  You'll need to make sure the account running IIS has permission to the folders.

    The only functionality I added to this is allowing a user to open the imagemanager, and selct a file and upload files.  Any other functionality of the 


    you'll need to add your own code.

    Also, you'll need to add the Telerik.web.UI.dll to the bin folder to get this to run.
  2. Rumen
    Rumen avatar
    12782 posts

    Posted 08 Jul 2009 Link to this post

    Hi Kris,

    Thank you for the provided solution - it will surely be useful for the other members of the Telerik community.

    Best regards,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. k f
    k f avatar
    109 posts
    Member since:
    Jun 2006

    Posted 08 Jul 2009 Link to this post

    Update:  There is some kind of issue when the imagemanager opens with this code with the Q1 09 version.  The exception which gets thrown is there is an invalid escape sequence when it tries to populate the files of a directory.

    I can't say what the issue is but it doesn't happen with Q2 2009 version.  I stumbled upon this after I originally wrote this separate in a project using the Q2 2009 assembly which I posted here.  I then integrated the code into a project which I had the Q1 version of Telerik running Image Manager would throw an exception.

    Again, I'm not sure where the problem lies but I can only vouch that this works in Q2.

    Additionally, if you have an admin directory other than the websites you're updating, you'll need to change the appSetting for the handler to this.



    add key="CMS.ItemHandler" value="Handler.ashx"/>

    You'll also need to update the code in the constructor so it doesn't prepend the applicationPath.

    Something such as this:  (You'll see the existing code is in this snippet commented out.


     _itemHandlerPath = ConfigurationManager.AppSettings["CMS.ItemHandler"];  
            if (_itemHandlerPath.StartsWith("~/"))  
                //string appPath = HttpContext.Current.Request.ApplicationPath;  
                //if (appPath == "/") _itemHandlerPath = appPath + _itemHandlerPath.Substring(2);  
                //else _itemHandlerPath = appPath + _itemHandlerPath.Substring(1);  
                _itemHandlerPath_itemHandlerPath = _itemHandlerPath.Substring(2);  

  4. Giovanni De Lazzari
    Giovanni De Lazzari avatar
    16 posts
    Member since:
    Sep 2006

    Posted 08 May 2012 Link to this post

    I'm try this sample but doesn't work with the subfolders
    I have the following situation:;
    this is my root
    and I can see all the files jpg files in this folder
    I have also a folder "media" under this level

    and the  image manager don't show me the contents
    only if I add media to the
    I can see the files inside 
    but why ??
    I whould like to navigate from the root under the subfolders

  5. Rumen
    Rumen avatar
    12782 posts

    Posted 11 May 2012 Link to this post


    My suggestion is to try the solution in this KB article: Use RadFileExplorer with physical and shared folder's paths.

    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.
Back to Top