This is a migrated thread and some comments may be shown as answers.

connect to a folder structure through DFS?

8 Answers 312 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Darcy
Top achievements
Rank 1
Darcy asked on 15 Sep 2009, 03:39 PM
Is there a way to connect to a folder structure through DFS?

Thank you

8 Answers, 1 is accepted

Sort by
0
ManniAT
Top achievements
Rank 2
answered on 16 Sep 2009, 09:17 PM
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"
0
Darcy
Top achievements
Rank 1
answered on 17 Sep 2009, 09:03 PM

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

0
ManniAT
Top achievements
Rank 2
answered on 17 Sep 2009, 09:18 PM
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
0
Darcy
Top achievements
Rank 1
answered on 17 Sep 2009, 10:07 PM

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

0
Accepted
Fiko
Telerik team
answered on 18 Sep 2009, 08:29 AM
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.
0
Darcy
Top achievements
Rank 1
answered on 21 Sep 2009, 05:18 PM
Hi,


I was able to make it work!

Thank you,
    Darcy

0
Technology
Top achievements
Rank 1
answered on 01 Nov 2010, 03:57 PM
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
0
Fiko
Telerik team
answered on 03 Nov 2010, 12:59 PM
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
Tags
FileExplorer
Asked by
Darcy
Top achievements
Rank 1
Answers by
ManniAT
Top achievements
Rank 2
Darcy
Top achievements
Rank 1
Fiko
Telerik team
Technology
Top achievements
Rank 1
Share this question
or