Welcome Guest Search | Active Topics | Sign In | Register

file explorer path mapping Options
Paradox Engineering
Posted: Thursday, December 31, 2009 9:41:57 AM
Rank: Member
Groups: Member

Joined: 7/2/2009
Posts: 25
Hi. look at this piece of code:

string path = l_util.user_path(this.Page.User.Identity.Name);
if (path != "")
{
this.FileExplorer1.RootFolder = "~/file_upload_root/" + path;
EO.Web.PathMapping mapping = new EO.Web.PathMapping();
mapping.Path = this.FileExplorer1.RootFolder.ToString();
mapping.DisplayName = "Files";
FileExplorer1.PathMappings.Add(mapping);
}


i'm trying not to show full rootfolder to user buy only friendly name but it doesn't go. am i doin something wrong?

best regards
eo_support
Posted: Thursday, December 31, 2009 11:07:43 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

The Path property for the PathMapping object should be physical file path, not virtual path.

Thanks!
Paradox Engineering
Posted: Friday, January 1, 2010 10:02:00 AM
Rank: Member
Groups: Member

Joined: 7/2/2009
Posts: 25
eo_support wrote:
Hi,

The Path property for the PathMapping object should be physical file path, not virtual path.

Thanks!


ok, thanks for explaination. is it possible in some way to hide path to users?
eo_support
Posted: Sunday, January 3, 2010 7:54:15 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

PathMapping is what you use to hide the path. You just need to configure it correctly. You were using virtual path instead of physical path in your code so it won't work for you because it can not match any path.

Thanks!
Paradox Engineering
Posted: Tuesday, January 5, 2010 9:46:35 AM
Rank: Member
Groups: Member

Joined: 7/2/2009
Posts: 25
eo_support wrote:
Hi,

PathMapping is what you use to hide the path. You just need to configure it correctly. You were using virtual path instead of physical path in your code so it won't work for you because it can not match any path.

Thanks!


ok so something like this?

this.FileExplorer1.RootFolder = "C:/file_kiosk_app_users/File_upload_root/";
EO.Web.PathMapping mapping = new EO.Web.PathMapping();
mapping.Path = this.FileExplorer1.RootFolder.ToString();
mapping.DisplayName = "Files";
mapping.Url = "http://mysite.com/Files";
FileExplorer1.PathMappings.Add(mapping);


but i see the same path in file explorer, and file selected has same file path:

"C:/file_kiosk_app_users/File_upload_root/file.txt"

am i doin something wrong?
eo_support
Posted: Tuesday, January 5, 2010 9:52:06 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

PathMapping can change what the TreeView displays. It does not change anything else. I am not sure why you set RootPath as physical path though. Usually RootPath is relative path. Only PathMapping.Path needs to be physical path.

Thanks
Paradox Engineering
Posted: Tuesday, January 5, 2010 1:53:47 PM
Rank: Member
Groups: Member

Joined: 7/2/2009
Posts: 25
eo_support wrote:
Hi,

PathMapping can change what the TreeView displays. It does not change anything else. I am not sure why you set RootPath as physical path though. Usually RootPath is relative path. Only PathMapping.Path needs to be physical path.

Thanks



ok i understand. so something like this?

this.FileExplorer1.RootFolder = "~/File_upload_root/folder";
EO.Web.PathMapping mapping = new EO.Web.PathMapping();
mapping.Path = "C:/file_kiosk_app_users/File_upload_root/folder";
mapping.DisplayName = "My Files";
mapping.Url = "http://mysite.com/Files";
FileExplorer1.PathMappings.Add(mapping);


i really don't get the focus on this problem!! in this case, what i have in treeview is "/File_upload_root/folder", and selected file "/File_upload_root/folder/file.txt". i thought instead with pathmapping that i could hide path "/File_upload_root/folder" from treeview and client could see "My files" as starting root. this is what i need, to hide starting folder to client.
eo_support
Posted: Wednesday, January 6, 2010 11:07:50 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Try this:

Code: C#
this.FileExplorer1.RootFolder = 
    "C:/file_kiosk_app_users/File_upload_root/folder";
EO.Web.PathMapping mapping = new EO.Web.PathMapping();
mapping.Path = "C:/file_kiosk_app_users/File_upload_root/folder";
mapping.DisplayName = "My Files";
mapping.Url = "http://mysite.com/Files";
FileExplorer1.PathMappings.Add(mapping);


Note both RootFolder and mapping.Path are physical path.

Thanks
Paradox Engineering
Posted: Thursday, January 7, 2010 12:33:17 PM
Rank: Member
Groups: Member

Joined: 7/2/2009
Posts: 25
eo_support wrote:
Hi,

Try this:

Code: C#
this.FileExplorer1.RootFolder = 
    "C:/file_kiosk_app_users/File_upload_root/folder";
EO.Web.PathMapping mapping = new EO.Web.PathMapping();
mapping.Path = "C:/file_kiosk_app_users/File_upload_root/folder";
mapping.DisplayName = "My Files";
mapping.Url = "http://mysite.com/Files";
FileExplorer1.PathMappings.Add(mapping);


Note both RootFolder and mapping.Path are physical path.

Thanks


no way. the result is that in file explorer i see as root folder

"C:/file_kiosk_app_users/File_upload_root/folder"

and selected file is

"C:/file_kiosk_app_users/File_upload_root/folder/myfile"-
eo_support
Posted: Thursday, January 7, 2010 12:38:01 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
We have tested the code with the latest version and it shows the root folder correctly as "My Files". So you may want to check your version first.

Thanks
Paradox Engineering
Posted: Thursday, January 14, 2010 12:56:43 PM
Rank: Member
Groups: Member

Joined: 7/2/2009
Posts: 25
Our EO version is 7.0.46.2.
is the same that you use for your test?

thanks
eo_support
Posted: Thursday, January 14, 2010 2:24:44 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Yes.
Paradox Engineering
Posted: Friday, January 15, 2010 10:39:55 AM
Rank: Member
Groups: Member

Joined: 7/2/2009
Posts: 25
this is full code, and it doesn't work. Can you check it?
Thx

test.aspx page
Code: HTML/ASPX
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">    
    <eo:FileExplorer ID="fe1" runat="server" RootFolder="C:">
        <LayoutTemplate>
            <eo:TreeView id="FolderTree" runat="server">
					<LookNodes>
						<eo:TreeNode ImageUrl="00030301" DisabledStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;color:Gray;padding-bottom:1px;padding-left:1px;padding-right:1px;padding-top:1px;"
							CollapsedImageUrl="00030301" ItemID="_Default" NormalStyle-CssText="PADDING-RIGHT: 1px; PADDING-LEFT: 1px; PADDING-BOTTOM: 1px; COLOR: black; BORDER-TOP-STYLE: none; PADDING-TOP: 1px; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: transparent; BORDER-BOTTOM-STYLE: none"
							ExpandedImageUrl="00030302" SelectedStyle-CssText="background-color:#316ac5;border-bottom-color:#999999;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#999999;border-left-style:solid;border-left-width:1px;border-right-color:#999999;border-right-style:solid;border-right-width:1px;border-top-color:#999999;border-top-style:solid;border-top-width:1px;color:White;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;"></eo:TreeNode>
					</LookNodes>
					<TopGroup Style-CssText="background-color:white;color:black;cursor:hand;font-family:Tahoma;font-size:8pt;">
						<Nodes></Nodes>
					</TopGroup>
				</eo:TreeView>
        </LayoutTemplate>
    </eo:FileExplorer>    
    </form>
</body>
</html>


and the behind code test.cs
Code: C#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class test : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        EO.Web.PathMapping p = new EO.Web.PathMapping();
        p.Path = "C";
        p.DisplayName = "My files";
        p.Url = "C";
        fe1.PathMappings.Add(p);
    }    
}
eo_support
Posted: Friday, January 15, 2010 11:04:45 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

We are not in a position to troubleshoot your code. We have clearly told you how you should use it and provided sample code that works. So you will want to follow those and get those working first. If the sample works for you and your code does not, then you should compare your code with the sample code. What we can not do is look into your code and tell you what's wrong whenever you have a coding issue. Those will be your sole responsibility.

Thanks!
Paradox Engineering
Posted: Monday, January 18, 2010 9:06:41 AM
Rank: Member
Groups: Member

Joined: 7/2/2009
Posts: 25
sorry, i don't want you to troubleshoot our code. I want only to show you that i follow your instruction but it doesn't work.

I publish a test web site here:
http://geomapper.pdxeng.ch/test/test.aspx

In the label you can see the properties value, and the path value of pathmapping is static and the root folder of file explorer is virtual

here
http://geomapper.pdxeng.ch/test/test_static.aspx
all the paths are static

You can download the code that is equal to your posted code.

Thanks
eo_support
Posted: Monday, January 18, 2010 11:01:45 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

We have found the problem. Please try to move the code that sets the PathMapping object before setting RootFolder. For example:

Code: C#
EO.Web.PathMapping p = new EO.Web.PathMapping();
string path = Server.MapPath("~/test");
p.Path = path;
p.DisplayName = "My files";
p.Url = "http://www.mysite.com";
fe1.PathMappings.Add(p);

//Set root folder last
fe1.RootFolder = path;


Please let us know if it works for you.

Thanks!
Paradox Engineering
Posted: Monday, January 18, 2010 11:39:14 AM
Rank: Member
Groups: Member

Joined: 7/2/2009
Posts: 25
yes!! it works!
Great! Thanks!
eo_support
Posted: Monday, January 18, 2010 12:10:11 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Great! Thanks for the update!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.