Use FileBrowserContentProvider with Physical Path

Thread is closed for posting
5 posts, 0 answers
  1. BF42EC85-B935-4155-BBB8-2DF2BAB6B5E8
    BF42EC85-B935-4155-BBB8-2DF2BAB6B5E8 avatar
    109 posts
    Member since:
    Jun 2006

    Posted 05 Jul 2009 Link to this post

    Requirements

    RadControls version

    Q1 & Q2  2009

    .NET version

    3.5

    Visual Studio version

    2008

    programming language

    C#    

    browser support

    all browsers supported by RadControls


    PROJECT DESCRIPTION
    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 

    FileBrowserContentProvider

    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. DF60784D-55A5-4263-9F10-A12FA48C9ADC
    DF60784D-55A5-4263-9F10-A12FA48C9ADC avatar
    14477 posts
    Member since:
    Apr 2022

    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,
    Rumen
    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. BF42EC85-B935-4155-BBB8-2DF2BAB6B5E8
    BF42EC85-B935-4155-BBB8-2DF2BAB6B5E8 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. 48A57D1A-682F-4C52-B2E4-FB23B9F99191
    48A57D1A-682F-4C52-B2E4-FB23B9F99191 avatar
    16 posts
    Member since:
    Sep 2006

    Posted 08 May 2012 Link to this post

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

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

  5. DF60784D-55A5-4263-9F10-A12FA48C9ADC
    DF60784D-55A5-4263-9F10-A12FA48C9ADC avatar
    14477 posts
    Member since:
    Apr 2022

    Posted 11 May 2012 Link to this post

    Hi,

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

    Kind regards,
    Rumen
    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

This Code Library is part of the product documentation and subject to the respective product license agreement.