connect to a folder structure through DFS?

9 posts, 1 answers
  1. Darcy
    Darcy avatar
    4 posts
    Member since:
    Dec 2007

    Posted 15 Sep 2009 Link to this post

    Is there a way to connect to a folder structure through DFS?

    Thank you
  2. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 16 Sep 2009 Link to this post

    Hi Darcy,

    the filecontentprovider uses Server.MapPath to translate a url to a physical path.
    So it depends on how (mapped driver, unc...) the IIS account can map your DFS paths.

    If Server.MapPath does not work - you can overcome the situation by providing your own filecontentprovider.
    This in not really hard - see the samples: http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/dbfilebrowsercontentprovider/defaultcs.aspx

    Or play with my Code Library sample:
    http://www.telerik.com/community/code-library/aspnet-ajax/file-explorer/extending-the-radfileexplorer.aspx
    Or take a look at this code library entry which works with physical paths:
    http://www.telerik.com/community/code-library/aspnet-ajax/file-explorer/use-local-path-instead.aspx

    Regards
    Manfred
    PS: if this post was helpful please use "Mark as answer"
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Darcy
    Darcy avatar
    4 posts
    Member since:
    Dec 2007

    Posted 17 Sep 2009 Link to this post

    Hi,

    I have tried these all and the problem is that when I give the control a path named \\Server.MapPath\folder\folder the code cuts off the first "/" from the path and reverses the slashes: such as /Server.MapPath/folder/folder and of course I get the error Failed to map path. So how do I tell the control to not look at the physical IIS server that the website is on but instead for it to use the server that I wish it to go to?

    Thank you, 
        Darcy

  5. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 17 Sep 2009 Link to this post

    Hi Darcy,

    sorry about the confusion - Server.MapPath is not a path - it is a method you can call in code behind.
    http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.mappath.aspx

    The problem (I guess from your post) will be different.
    First of all - it's not the control - it's all about security access to the network and other things like this.
    Normally your site will run as "NETWORKSERVICE" - that is (if in the same AD domain) the account WebServerName$.
    Take a look at the last answer here:
    http://serverfault.com/questions/41130/network-service-account-accessing-a-folder-share

    So the primary goal is to achieve access to the DFS folder.
    By the way - here comes an extra layer of security.
    You IIS Account must haver permissions to access the DFS - and the permissions on the physical path behind it.

    If you are able to open (simply as response to a button click on a testpage) open a file using the DFS path you are almost done.

    BUT - think about security if the server is "out in the wild" and the DFS is not part of the DMZ!!

    Regards
    Manfred
  6. Darcy
    Darcy avatar
    4 posts
    Member since:
    Dec 2007

    Posted 17 Sep 2009 Link to this post

    Hi,

    It is not security, that is not the problem I am having with the control’s connection to folders. It is because the code behind the control changes the path structure that I am asking it to use.

    I am able to use a TreeView from VS.Net and connect to that folder structure using a directory.Getdirectories(\\DFS\ folder\folder) and then load the nodes, without a problem.

     

    Therefore, can the control connect to a server using DFS and if so can you post a sample of how this is done.

     

    Thank you,

                Darcy

  7. Answer
    Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 18 Sep 2009 Link to this post

    Hi Darcy,

    By default the RadFileExplorer works with virtual paths only. In your case you need to use a custom file browser content provider that will work with DFS paths. Please note that, by default the PathSeparator  symbol (in the FileBrowserContentProvider) is set to '/'. In your case you need to override this setting :

    public override char PathSeparator 
        get 
        { 
            return '\'
        } 
     

    Additionally, I recommend you check the information provided in this KB article as well.
    I hope this helps.

    Greetings,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. Darcy
    Darcy avatar
    4 posts
    Member since:
    Dec 2007

    Posted 21 Sep 2009 Link to this post

    Hi,


    I was able to make it work!

    Thank you,
        Darcy

  9. Technology
    Technology avatar
    53 posts
    Member since:
    Jul 2010

    Posted 01 Nov 2010 Link to this post

    Dear Fiko  hello,

    i'm having the same problem with Darcy (physical path error with / and \)

    I understand you answer but is there any easier way to load physical path into File Explorer, or to change the char "/" to "\" ?
    I get the Physical path directly from my sql table and i don't need any mapped files.
    i don't need virtual paths because the address is not visible.

    I use:
     V.S. ASP.NET 2008 (VB)
     ASP.NET AJAX Rad Controls 2010.2.929.35 Trial.

    Thank you in advance for your time.

    Best Regards,
    Navarino Technology Department
  10. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 03 Nov 2010 Link to this post

    Hello Technology,

    By default, RadFileExplorer works with virtual folders only, that are part of the application. This is because the default FileBrowserContentProvider uses Server.MapPath in odder to get the physical path of the folders. Then this physical paths is used in order to list the content of the folders (suing the objects and methods from the System.IO namespace).
    In your case you have to implement a custom FileBrowserContent provider which will work with physical paths and I recommend you to modify this one in order to fit your needs.

    Best wishes,
    Fiko
    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017