How to lock down ImageManager paths?

5 posts, 0 answers
  1. Tom Kaminski
    Tom Kaminski avatar
    7 posts
    Member since:
    Aug 2007

    Posted 08 Feb 2010 Link to this post

    My web site serves multiple customers where the content is customized depending on the domain name used to access the site.  As such, I have a subfolder under the images folder for each customer.  I can dynamically set the ImageManager paths in code using "~/images/" & CustID, but when the customer uses the ImageManager they always have access to the "images" folder.  How can I lock them into their CustId folder under images?  Is there a better approach?
  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 10 Feb 2010 Link to this post

    Hi Tom,

    By design, ImageManager does not provide access to the parent directory if it is not set as a path where  RadEditor should look for images.  Could you please provide a sample code which handles this manipulation so we can investigate it?


    <%-- This will provide access to both folders (and all their sub-folders if any)  but not to /images --%>
    <ImageManager ViewPaths="~/images/John,~/images/Peter" />
     
    <%-- Same as above but since /Peter is a sub-folder user will have access to it even with out its declaration --%>
    <ImageManager ViewPaths="~/images/,~/images/Peter" />

    For your convenience I have attached a movie showing the difference of the two declarations.

    Best wishes,
    Dobromir
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tom Kaminski
    Tom Kaminski avatar
    7 posts
    Member since:
    Aug 2007

    Posted 11 Feb 2010 Link to this post

    Thanks for your response.  Attached is an image of what I get - essentially I do not want users to be able to get into the images or photos folders, just the "1" subfolders.

    My code is as follows (in the Page_Load event):

    Dim viewpath As String() = {"~/images/" & DeptIDLabel.Value, "~/photos/" & DeptIDLabel.Value}  
    Editor1.ImageManager.ViewPaths = viewpath  
    Editor1.ImageManager.UploadPaths = viewpath 
  5. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 12 Feb 2010 Link to this post

    Hi Tom,

    The provided code looks OK. The only reason I can think of for this problem to occur is that DeptIDLabel.Value value is an empty string (""). If this is not the case, could you please open a support ticket and attach a sample runable project that reproduces the problem for further investigation?

    Greetings,
    Dobromir
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Tom Kaminski
    Tom Kaminski avatar
    7 posts
    Member since:
    Aug 2007

    Posted 13 Feb 2010 Link to this post

    Thanks Dobromir.

    As you can see by that attached image, DeptIDLabel.Value is in fact returning a valid value, "1" in this case.

     

    I will open a support ticket.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017