|
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
|
|
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!
|
|
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?
|
|
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!
|
|
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?
|
|
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
|
|
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.
|
|
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
|
|
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"-
|
|
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
|
|
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
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Yes.
|
|
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);
}
}
|
|
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!
|
|
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.aspxIn 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.aspxall the paths are static You can download the code that is equal to your posted code. Thanks
|
|
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!
|
|
Rank: Member Groups: Member
Joined: 7/2/2009 Posts: 25
|
yes!! it works! Great! Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Great! Thanks for the update!
|
|