Home - Forums-.NET - FlyTreeView (ASP.NET) - FlyTreeView for ASP.NET 2.0 - FileSystemNodes - GetFiles

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

FlyTreeView for ASP.NET 2.0 - FileSystemNodes - GetFiles
Link Posted: 27-Feb-2007 18:53
When you go back the page is loaded with the state provided with page.
It is not the same as you had when clicked any file (folder).

From my point of view, you should set FlyTreeView.NavigateTarget to _blank to open files in a popup window.
Link Posted: 28-Feb-2007 06:38
Everything works great on my dev machine (localhost) but when I view files on the server I get Access Denied.

What do I need to do on the server for deployment?

Thanks!
Link Posted: 28-Feb-2007 07:07
Hi,

The problem is not with the server.  Running in dev. on localhost, any network drive works, z://,x://.  c:// populates the flytreeview but the navigateurl doesn't work.

any ideas?  Thanks!
Link Posted: 28-Feb-2007 07:42
This can be security restrictions of the browser.

All browsers by default restrict access from one zone to any resources within another zone.

It means that localhost as well as local drives are in your local zone, but when you deploy your application to server which is in Internet zone, everything changes and so you cannot access local resources.

To test restriction you can create a very simple HTML file with the only code.

testzone.html:

Z Drive

(or use any other drive).


Place it on to your server and check what happens when you click this link.
Link Posted: 28-Feb-2007 07:57
Well, this works the same way on the localhost and server.

The local drives c: d: dont work but the Z: or any network drive is ok.

The flytreeview is populating all the drives c: d: z: but the
navigateurl property is not working for the local drives.

The code I added to FileSystemNodes:

////////////
        FileInfo[] files = directory.GetFiles();
        foreach (FileInfo file in files)
        {
            FlyTreeNode ftn2 = new FlyTreeNode();
            ftn2.ImageUrl = \"images/file_xml.gif\";
            ftn2.Text = HttpUtility.HtmlEncode(file.Name);
            ftn2.Value = file.Name;
            ftn2.NavigateUrl = file.FullName;
            nodes.Add(ftn2);
        }
////////////

Is there any way to use the browser to view a file on c: or d: drive?

Also, when I run this on the server.  I have a Z: drive mapped but this doesn't get populated in flytreeview.

Thanks
Link Posted: 28-Feb-2007 08:20
It seems that browser determines Z: as a network drive and thus from the same zone as web page containing NavigateUrl. This is the reason why NavigateUrl works for Z: drive.

As I mentioned before, the FlyTreeView uses A element in form of
... to implement its NavigateUrl functionality.

I do not see other ways to enable opening local drives from page in other zone as to move this page (your server domain) to trusted sites (for IE).


Also, when I run this on the server. I have a Z: drive mapped but this doesn't get populated in flytreeview.

The Internet Information Services (IIS) on your server does not operate under the currently logged user, but uses NETWORK_SERVICE system user (or other defined in IIS settings). So IIS does not have Z: drive mapped in its working environment.
Link Posted: 28-Feb-2007 10:08
is there a way to view documents in a virtual directory on the server?  One that has interet and NTFS rights?

Hasn't anyone done this?
Link Posted: 28-Feb-2007 12:00
Hi,

I need to get the server relative path from FlytreeView.
This ftn2.NavigateUrl works when I hardcode the directory.

~/GEMSDOCS/HQ

ftn2.NavigateUrl = HttpUtility.HtmlEncode(\"GEMSdocs/HQ/\"+file.Name);


Thanks, I'm making progress.
Link Posted: 28-Feb-2007 18:42
Probably you can just use
ftn2.NavigateUrl = Page.ResolveUrl(\"~/GEMSdocs/HQ/\"+file.Name);
Link Posted: 01-Mar-2007 06:35
No, I'm loading all the directories in the web sub directory

~/GEMSdocs into the treeview.


I need the name of the subdirectories, such as

~/GEMSdocs/HQ/
~/GEMSdocs/Other Files/
~/GEMSdocs/Etc/

How do I get the relative path?