RadEditor's ImageManager and virtual directories

2 posts, 0 answers
  1. headPropellerHead
    headPropellerHead avatar
    15 posts
    Member since:
    Jul 2007

    Posted 16 Feb 2011 Link to this post

    Environment:
    Visual Studio 2008, C#, Rad Controls for ASP.NET AJAX v.2010.3.1317.35

    I am using RadEditor and trying to configure a virtual directory for the RadEditor.ImageManager.ViewPaths.

    I have used IIS Manager to create a virtual directory called Email under my website. If I click on that virtual directory in IIS Manager I can see the files that exist in the respective physical location. I can open a web browser and browse to the virtual directory URL, i.e. http://localhost/<websitename>/Email.

    I am setting the ImageManager ViewPaths property in codebehind:

     

    string[] viewImages = new string[] { "~/Email" };

     

     

    RadEditor1.ImageManager.ViewPaths = viewImages;

    When I run the application in the development environment and open the ImageManager for RadEditor, there are no files available for selection.

    If I create an Email folder under the website and point to that folder for the ViewPaths property, the files are available.

    How should I configure virtual directory so that the ImageManager can see the files properly when running in the Visual Studio 2008 development environment,

    Thanks for your help!

     

     

  2. Rumen
    Admin
    Rumen avatar
    13849 posts

    Posted 21 Feb 2011 Link to this post

    Hello Russ,

    This is a server problem not related to the FileBrowser dialogs. You should make sure that the Email folder is accessible as well as the files in it. You can use the code below for that purpose:

    using System.IO;
    ...
    protected void Page_Load(object sender, EventArgs e)
        {
            string resolvePath = Server.MapPath("~/Email");
            Response.Write("Images resolve to: " + resolvePath);
            foreach (string file in Directory.GetFiles(resolvePath))
            {
                Response.Write("<br/>File: " + file);
            }
        }

    The following KB articles could be helpful for this scenario:

    Using RadFileExplorer with physical and shared folder's
    and
    Uploading images and files to a Shared Drive.

    Best regards,
    Rumen
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top